pub struct LogLevelFilter(/* private fields */);Expand description
Atomic level filter that can be adjusted via logging/setLevel.
The level is stored as a u8 corresponding to LoggingLevel variants: 0=Debug, 1=Info, 2=Notice, 3=Warning, 4=Error, 5=Critical, 6=Alert, 7=Emergency
Implementations§
Source§impl LogLevelFilter
impl LogLevelFilter
Sourcepub fn new(level: LoggingLevel) -> Self
pub fn new(level: LoggingLevel) -> Self
Create a new filter with the given minimum level.
Sourcepub fn get(&self) -> LoggingLevel
pub fn get(&self) -> LoggingLevel
Get the current minimum level.
Sourcepub fn set(&self, level: LoggingLevel)
pub fn set(&self, level: LoggingLevel)
Set the minimum level.
Sourcepub fn should_log(&self, level: LoggingLevel) -> bool
pub fn should_log(&self, level: LoggingLevel) -> bool
Check if a message at the given level should be logged.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LogLevelFilter
impl RefUnwindSafe for LogLevelFilter
impl Send for LogLevelFilter
impl Sync for LogLevelFilter
impl Unpin for LogLevelFilter
impl UnwindSafe for LogLevelFilter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more