mirror of
https://gitee.com/openharmony/third_party_rust_log
synced 2024-11-27 01:40:27 +00:00
Add serde impls to LogLevel and LogLevelFilter
This commit is contained in:
parent
d9b22b4db7
commit
8b1523aa2f
@ -41,3 +41,6 @@ default = ["use_std"]
|
||||
[badges]
|
||||
travis-ci = { repository = "rust-lang-nursery/log" }
|
||||
appveyor = { repository = "alexcrichton/log" }
|
||||
|
||||
[dependencies]
|
||||
serde = { version = ">= 1.0.7", optional = true }
|
||||
|
@ -283,6 +283,7 @@ static LEVEL_PARSE_ERROR: &'static str = "attempted to convert a string that doe
|
||||
/// [`LevelFilter`](enum.LevelFilter.html).
|
||||
#[repr(usize)]
|
||||
#[derive(Copy, Eq, Debug, Hash)]
|
||||
#[cfg_attr(serde, derive(Serialize, Deserialize))]
|
||||
pub enum Level {
|
||||
/// The "error" level.
|
||||
///
|
||||
@ -427,6 +428,7 @@ impl Level {
|
||||
/// [`max_level()`](fn.max_level.html).
|
||||
#[repr(usize)]
|
||||
#[derive(Copy, Eq, Debug, Hash)]
|
||||
#[cfg_attr(serde, derive(Serialize, Deserialize))]
|
||||
pub enum LevelFilter {
|
||||
/// A level lower than all log levels.
|
||||
Off,
|
||||
|
Loading…
Reference in New Issue
Block a user