pub struct LogLevelEnforcer { /* private fields */ }Expand description
Enforces a minimum log level, suppressing events below the threshold.
Use LogLevelEnforcer::release() for production builds (strips Trace and
Debug) and LogLevelEnforcer::debug() for development (allows all levels).
Implementations§
Source§impl LogLevelEnforcer
impl LogLevelEnforcer
Sourcepub fn with_min_level(min_level: LogLevel) -> Self
pub fn with_min_level(min_level: LogLevel) -> Self
Creates an enforcer with a custom minimum log level.
Sourcepub fn should_emit(&self, level: LogLevel) -> bool
pub fn should_emit(&self, level: LogLevel) -> bool
Returns true if the given log level should be emitted (i.e. it is
at or above the configured minimum).
Trait Implementations§
Source§impl Clone for LogLevelEnforcer
impl Clone for LogLevelEnforcer
Source§fn clone(&self) -> LogLevelEnforcer
fn clone(&self) -> LogLevelEnforcer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LogLevelEnforcer
impl RefUnwindSafe for LogLevelEnforcer
impl Send for LogLevelEnforcer
impl Sync for LogLevelEnforcer
impl Unpin for LogLevelEnforcer
impl UnsafeUnpin for LogLevelEnforcer
impl UnwindSafe for LogLevelEnforcer
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