Enum LevelFilter
enum LevelFilter
An enum representing the available verbosity level filters of the logger.
A LevelFilter may be compared directly to a Level. Use this type
to get and set the maximum log level with max_level() and set_max_level.
Variants
-
Off A level lower than all log levels.
-
Error Corresponds to the
Errorlog level.-
Warn Corresponds to the
Warnlog level.-
Info Corresponds to the
Infolog level.-
Debug Corresponds to the
Debuglog level.-
Trace Corresponds to the
Tracelog level.
Implementations
impl LevelFilter
fn max() -> LevelFilterReturns the most verbose logging level filter.
fn to_level(self: &Self) -> Option<Level>Converts
selfto the equivalentLevel.Returns
NoneifselfisLevelFilter::Off.fn as_str(self: &Self) -> &'static strReturns the string representation of the
LevelFilter.This returns the same string as the
fmt::Displayimplementation.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 LevelFilter; let mut levels = iter; assert_eq!; assert_eq!;fn increment_severity(self: &Self) -> SelfGet the next-highest
LevelFilterfrom this one.If the current
LevelFilteris at the highest level, the returnedLevelFilterwill be the same as the current one.Examples
use LevelFilter; let level_filter = Info; assert_eq!; assert_eq!; assert_eq!; // max levelfn decrement_severity(self: &Self) -> SelfGet the next-lowest
LevelFilterfrom this one.If the current
LevelFilteris at the lowest level, the returnedLevelFilterwill be the same as the current one.Examples
use LevelFilter; let level_filter = Info; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // min level
impl Clone for LevelFilter
fn clone(self: &Self) -> LevelFilter
impl Copy for LevelFilter
impl Debug for LevelFilter
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for LevelFilter
fn fmt(self: &Self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for LevelFilter
impl Freeze for LevelFilter
impl FromStr for LevelFilter
fn from_str(level: &str) -> Result<LevelFilter, <Self as >::Err>
impl Hash for LevelFilter
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl Ord for LevelFilter
fn cmp(self: &Self, other: &LevelFilter) -> $crate::cmp::Ordering
impl PartialEq for LevelFilter
fn eq(self: &Self, other: &Level) -> bool
impl PartialEq for LevelFilter
fn eq(self: &Self, other: &LevelFilter) -> bool
impl PartialOrd for LevelFilter
fn partial_cmp(self: &Self, other: &LevelFilter) -> $crate::option::Option<$crate::cmp::Ordering>
impl PartialOrd for LevelFilter
fn partial_cmp(self: &Self, other: &Level) -> Option<cmp::Ordering>
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Serialize for crate::LevelFilter
fn serialize<S>(self: &Self, serializer: S) -> Result<<S as >::Ok, <S as >::Error> where S: Serializer
impl StructuralPartialEq for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnwindSafe for LevelFilter
impl<'de> Deserialize for crate::LevelFilter
fn deserialize<D>(deserializer: D) -> Result<Self, <D as >::Error> where D: Deserializer<'de>
impl<T> Any for LevelFilter
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for LevelFilter
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for LevelFilter
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for LevelFilter
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> DeserializeOwned for LevelFilter
impl<T> From for LevelFilter
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for LevelFilter
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for LevelFilter
fn to_string(self: &Self) -> String
impl<T, U> Into for LevelFilter
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 LevelFilter
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for LevelFilter
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>