Enum Level
#[repr(usize)]
pub enum Level
An enum representing the available verbosity levels of the logger.
Typical usage includes: checking if a certain Level is enabled with
log_enabled!, specifying the Level of
log!, and comparing a Level directly to a
LevelFilter.
Variants
-
Error = 1 The "error" level.
Designates very serious errors.
-
Warn The "warn" level.
Designates hazardous situations.
-
Info The "info" level.
Designates useful information.
-
Debug The "debug" level.
Designates lower priority information.
-
Trace The "trace" level.
Designates very low priority, often extremely verbose, information.
Implementations
impl Level
fn max() -> LevelReturns the most verbose logging level.
fn to_level_filter(&self) -> LevelFilterConverts the
Levelto the equivalentLevelFilter.fn as_str(&self) -> &'static strReturns the string representation of the
Level.This returns the same string as the
fmt::Displayimplementation.fn iter() -> impl Iterator<Item = Self>Iterate through all supported logging levels.
The order of iteration is from more severe to less severe log messages.
Examples
use Level; let mut levels = iter; assert_eq!; assert_eq!;fn increment_severity(&self) -> SelfGet the next-highest
Levelfrom this one.If the current
Levelis at the highest level, the returnedLevelwill be the same as the current one.Examples
use Level; let level = Info; assert_eq!; assert_eq!; assert_eq!; // max levelfn decrement_severity(&self) -> SelfGet the next-lowest
Levelfrom this one.If the current
Levelis at the lowest level, the returnedLevelwill be the same as the current one.Examples
use Level; let level = Info; assert_eq!; assert_eq!; assert_eq!; // min level
Trait Implementations
impl Clone for Level
fn clone(&self) -> Self
impl Copy for Level
impl Debug for Level
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Level
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
impl Eq for Level
impl FromStr for Level
type Err = ParseLevelError;fn from_str(level: &str) -> Result<Level, Self::Err>
impl Hash for Level
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Level
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Level
fn eq(&self, other: &Self) -> bool
impl PartialEq<LevelFilter> for Level
fn eq(&self, other: &LevelFilter) -> bool
impl PartialOrd for Level
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl PartialOrd<LevelFilter> for Level
fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
impl Serialize for Level
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer,
impl StructuralPartialEq for Level
impl<'de> Deserialize<'de> for Level
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>,
Auto Trait Implementations
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnsafeUnpin for Level
impl UnwindSafe for Level
Blanket Implementations
impl<T> Any for Level
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Level
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Level
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Level
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> DeserializeOwned for Level
where
T: for<'de> Deserialize<'de>,
impl<T> From<T> for Level
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Level
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Level
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Level
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Level
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Level
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>