Enum Level
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 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: &Self) -> LevelFilterConverts the
Levelto the equivalentLevelFilter.fn as_str(self: &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: &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: &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
impl Clone for Level
fn clone(self: &Self) -> Level
impl Copy for Level
impl Debug for Level
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for Level
fn fmt(self: &Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for Level
impl Freeze for Level
impl FromStr for Level
fn from_str(level: &str) -> Result<Level, <Self as >::Err>
impl Hash for Level
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl Ord for Level
fn cmp(self: &Self, other: &Level) -> $crate::cmp::Ordering
impl PartialEq for Level
fn eq(self: &Self, other: &LevelFilter) -> bool
impl PartialEq for Level
fn eq(self: &Self, other: &Level) -> bool
impl PartialOrd for Level
fn partial_cmp(self: &Self, other: &Level) -> $crate::option::Option<$crate::cmp::Ordering>
impl PartialOrd for Level
fn partial_cmp(self: &Self, other: &LevelFilter) -> Option<cmp::Ordering>
impl RefUnwindSafe for Level
impl Send for Level
impl Serialize for crate::Level
fn serialize<S>(self: &Self, serializer: S) -> Result<<S as >::Ok, <S as >::Error> where S: Serializer
impl StructuralPartialEq for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
impl<'de> Deserialize for crate::Level
fn deserialize<D>(deserializer: D) -> Result<Self, <D as >::Error> where D: Deserializer<'de>
impl<T> Any for Level
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Level
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Level
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Level
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> DeserializeOwned for Level
impl<T> From for Level
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Level
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Level
fn to_string(self: &Self) -> String
impl<T, U> Into for Level
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Level
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Level
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>