#[repr(align(4))]pub enum LevelFilter {
Off,
Equal(Level),
NotEqual(Level),
MoreSevere(Level),
MoreSevereEqual(Level),
MoreVerbose(Level),
MoreVerboseEqual(Level),
All,
}
Expand description
Represents log level logical filter conditions.
Use LevelFilter::test
method to check if a Level
satisfies the
filter condition.
Variants§
Off
Disables all levels.
Equal(Level)
Enables if the target level is equal to the filter level.
NotEqual(Level)
Enables if the target level is not equal to the filter level.
MoreSevere(Level)
Enables if the target level is more severe than the filter level.
MoreSevereEqual(Level)
Enables if the target level is more severe than or equal to the filter level.
MoreVerbose(Level)
Enables if the target level is more verbose than the filter level.
MoreVerboseEqual(Level)
Enables if the target level is more verbose than or equal to the filter level.
All
Enables all levels.
Implementations§
Source§impl LevelFilter
impl LevelFilter
Sourcepub fn compare(&self, level: Level) -> bool
👎Deprecated since 0.4.0: it may be removed in the future, use method test()
instead
pub fn compare(&self, level: Level) -> bool
test()
insteadChecks the given level if satisfies the filter condition.
Sourcepub fn test(&self, level: Level) -> bool
pub fn test(&self, level: Level) -> bool
Checks the given level if satisfies the filter condition.
§Examples
use spdlog::prelude::*;
let level_filter = LevelFilter::MoreSevere(Level::Info);
assert_eq!(level_filter.test(Level::Trace), false);
assert_eq!(level_filter.test(Level::Info), false);
assert_eq!(level_filter.test(Level::Warn), true);
assert_eq!(level_filter.test(Level::Error), true);
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 From<LevelFilter> for LevelFilter
Available on crate feature log
only.
impl From<LevelFilter> for LevelFilter
Available on crate feature
log
only.Source§fn from(filter: LevelFilter) -> Self
fn from(filter: LevelFilter) -> Self
Converts to this type from the input type.
Source§impl Hash for LevelFilter
impl Hash for LevelFilter
Source§impl PartialEq for LevelFilter
impl PartialEq for LevelFilter
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§
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