#[repr(usize)]pub enum LevelFilter {
Off = 0,
Error = 1,
Warn = 2,
Info = 3,
Debug = 4,
Trace = 5,
}
Expand description
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 = 0
A level lower than all log levels.
Error = 1
Corresponds to the Error
log level.
Warn = 2
Corresponds to the Warn
log level.
Info = 3
Corresponds to the Info
log level.
Debug = 4
Corresponds to the Debug
log level.
Trace = 5
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 = LevelFilter>
pub fn iter() -> impl Iterator<Item = LevelFilter>
Iterate through all supported filtering levels.
The order of iteration is from less to more verbose filtering.
§Examples
use 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
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LevelFilter
impl Debug for LevelFilter
Source§impl Display for LevelFilter
impl Display for LevelFilter
Source§impl FromStr for LevelFilter
impl FromStr for LevelFilter
Source§type Err = ParseLevelError
type Err = ParseLevelError
Source§fn from_str(level: &str) -> Result<LevelFilter, <LevelFilter as FromStr>::Err>
fn from_str(level: &str) -> Result<LevelFilter, <LevelFilter as FromStr>::Err>
s
to return a value of this type. Read moreSource§impl Hash for LevelFilter
impl Hash for LevelFilter
Source§impl Ord for LevelFilter
impl Ord for LevelFilter
Source§impl PartialEq<Level> for LevelFilter
impl PartialEq<Level> for LevelFilter
Source§impl PartialEq for LevelFilter
impl PartialEq for LevelFilter
Source§impl PartialOrd<Level> for LevelFilter
impl PartialOrd<Level> for LevelFilter
Source§impl PartialOrd for LevelFilter
impl PartialOrd for LevelFilter
Source§fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
impl Copy for LevelFilter
impl Eq for LevelFilter
impl StructuralPartialEq for LevelFilter
Auto Trait Implementations§
impl Freeze for LevelFilter
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnwindSafe for LevelFilter
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,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)