pub struct LogLazy { /* private fields */ }Expand description
Logger instance with a mutable bitmask and lazy message evaluation.
Implementations§
Source§impl LogLazy
impl LogLazy
Sourcepub fn with_options(options: LogLazyOptions) -> Self
pub fn with_options(options: LogLazyOptions) -> Self
Creates a logger from the extensible options API.
Sourcepub fn with_level<'a, L>(level: L) -> Self
pub fn with_level<'a, L>(level: L) -> Self
Creates a logger with a custom level.
Sourcepub fn with_level_and_presets<'a, L, I, S>(level: L, presets: I) -> Self
pub fn with_level_and_presets<'a, L, I, S>(level: L, presets: I) -> Self
Creates a logger with a custom level and custom presets.
Sourcepub fn add_preset(&mut self, name: impl Into<String>, mask: LevelMask)
pub fn add_preset(&mut self, name: impl Into<String>, mask: LevelMask)
Adds or replaces a named preset.
Sourcepub fn level_or_default<'a, L>(&self, level: L, default: LevelMask) -> LevelMask
pub fn level_or_default<'a, L>(&self, level: L, default: LevelMask) -> LevelMask
Resolves a string or numeric level to a mask, falling back to default.
Sourcepub fn should_log<'a, L>(&self, level: L) -> bool
pub fn should_log<'a, L>(&self, level: L) -> bool
Checks whether a level is currently enabled.
Sourcepub fn enable_level<'a, L>(&mut self, level: L)
pub fn enable_level<'a, L>(&mut self, level: L)
Enables one level bit or mask.
Sourcepub fn disable_level<'a, L>(&mut self, level: L)
pub fn disable_level<'a, L>(&mut self, level: L)
Disables one level bit or mask.
Sourcepub fn get_enabled_levels(&self) -> Vec<&'static str>
pub fn get_enabled_levels(&self) -> Vec<&'static str>
Returns enabled standard level names in stable order.
Sourcepub fn emit_args<'a, L, I>(&self, level: L, args: I)
pub fn emit_args<'a, L, I>(&self, level: L, args: I)
Logs explicit lazy arguments at an explicit level.
pub fn fatal<F, M>(&self, message: F)
pub fn warn<F, M>(&self, message: F)
pub fn info<F, M>(&self, message: F)
pub fn debug<F, M>(&self, message: F)
pub fn verbose<F, M>(&self, message: F)
pub fn trace<F, M>(&self, message: F)
pub fn silly<F, M>(&self, message: F)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogLazy
impl !RefUnwindSafe for LogLazy
impl Send for LogLazy
impl Sync for LogLazy
impl Unpin for LogLazy
impl UnsafeUnpin for LogLazy
impl !UnwindSafe for LogLazy
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