Enum lunatic_log::LevelFilter
source · #[repr(usize)]pub enum LevelFilter {
Off,
Error,
Warn,
Info,
Debug,
Trace,
}
Expand description
An enum representing the available verbosity level filters of the logger.
A LevelFilter
may be compared directly to a Level
.
Variants§
Off
A level lower than all log levels.
Error
Corresponds to the Error
log level.
Warn
Corresponds to the Warn
log level.
Info
Corresponds to the Info
log level.
Debug
Corresponds to the Debug
log level.
Trace
Corresponds to the Trace
log level.
Implementations§
source§impl LevelFilter
impl LevelFilter
sourcepub fn max() -> LevelFilter
pub fn max() -> LevelFilter
Returns the most verbose logging level filter.
sourcepub fn to_level(&self) -> Option<Level>
pub fn to_level(&self) -> Option<Level>
Converts self
to the equivalent Level
.
Returns None
if self
is LevelFilter::Off
.
sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the string representation of the LevelFilter
.
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 filtering levels.
The order of iteration is from less to more verbose filtering.
Examples
use lunatic_log::LevelFilter;
let mut levels = LevelFilter::iter();
assert_eq!(Some(LevelFilter::Off), levels.next());
assert_eq!(Some(LevelFilter::Trace), levels.last());
Trait Implementations§
source§impl Clone for LevelFilter
impl Clone for LevelFilter
source§fn clone(&self) -> LevelFilter
fn clone(&self) -> LevelFilter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LevelFilter
impl Debug for LevelFilter
source§impl<'de> Deserialize<'de> for LevelFilter
impl<'de> Deserialize<'de> for LevelFilter
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for LevelFilter
impl Display for LevelFilter
source§impl FromStr for LevelFilter
impl FromStr for LevelFilter
source§impl Hash for LevelFilter
impl Hash for LevelFilter
source§impl Ord for LevelFilter
impl Ord for LevelFilter
source§fn cmp(&self, other: &LevelFilter) -> Ordering
fn cmp(&self, other: &LevelFilter) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<Level> for LevelFilter
impl PartialEq<Level> for LevelFilter
source§impl PartialEq<LevelFilter> for Level
impl PartialEq<LevelFilter> for Level
source§fn eq(&self, other: &LevelFilter) -> bool
fn eq(&self, other: &LevelFilter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<LevelFilter> for LevelFilter
impl PartialEq<LevelFilter> for LevelFilter
source§fn eq(&self, other: &LevelFilter) -> bool
fn eq(&self, other: &LevelFilter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Level> for LevelFilter
impl PartialOrd<Level> for LevelFilter
source§impl PartialOrd<LevelFilter> for Level
impl PartialOrd<LevelFilter> for Level
source§fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
source§fn lt(&self, other: &LevelFilter) -> bool
fn lt(&self, other: &LevelFilter) -> bool
source§fn le(&self, other: &LevelFilter) -> bool
fn le(&self, other: &LevelFilter) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§fn gt(&self, other: &LevelFilter) -> bool
fn gt(&self, other: &LevelFilter) -> bool
source§impl PartialOrd<LevelFilter> for LevelFilter
impl PartialOrd<LevelFilter> for LevelFilter
source§fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
source§fn lt(&self, other: &LevelFilter) -> bool
fn lt(&self, other: &LevelFilter) -> bool
source§fn le(&self, other: &LevelFilter) -> bool
fn le(&self, other: &LevelFilter) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§fn gt(&self, other: &LevelFilter) -> bool
fn gt(&self, other: &LevelFilter) -> bool
source§impl Serialize for LevelFilter
impl Serialize for LevelFilter
impl Copy for LevelFilter
impl Eq for LevelFilter
impl StructuralEq for LevelFilter
impl StructuralPartialEq for LevelFilter
Auto Trait Implementations§
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnwindSafe for LevelFilter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more