#[repr(usize)]pub enum Level {
Error = 1,
Warn = 2,
Info = 3,
Debug = 4,
Trace = 5,
}
Expand description
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 = 2
The “warn” level.
Designates hazardous situations.
Info = 3
The “info” level.
Designates useful information.
Debug = 4
The “debug” level.
Designates lower priority information.
Trace = 5
The “trace” level.
Designates very low priority, often extremely verbose, information.
Implementations§
source§impl Level
impl Level
sourcepub fn to_level_filter(&self) -> LevelFilter
pub fn to_level_filter(&self) -> LevelFilter
Converts the Level
to the equivalent LevelFilter
.
sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the string representation of the Level
.
This returns the same string as the fmt::Display
implementation.
sourcepub fn iter() -> impl Iterator<Item = Self>
pub 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 log::Level;
let mut levels = Level::iter();
assert_eq!(Some(Level::Error), levels.next());
assert_eq!(Some(Level::Trace), levels.last());
Trait Implementations§
source§impl Ord for Level
impl Ord for Level
source§impl PartialEq<Level> for LevelFilter
impl PartialEq<Level> for LevelFilter
source§impl PartialEq<LevelFilter> for Level
impl PartialEq<LevelFilter> for Level
source§impl PartialOrd<Level> for LevelFilter
impl PartialOrd<Level> for LevelFilter
source§impl PartialOrd<LevelFilter> for Level
impl PartialOrd<LevelFilter> for Level
source§impl PartialOrd for Level
impl PartialOrd for Level
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)