Struct bp3d_logger::Logger
source · pub struct Logger { /* private fields */ }Expand description
The main Logger type allows to control the entire logger state and submit messages for logging.
Implementations§
source§impl Logger
impl Logger
sourcepub fn enable_stdout(&self, flag: bool)
pub fn enable_stdout(&self, flag: bool)
sourcepub fn raw_log(&self, msg: &LogMsg)
pub fn raw_log(&self, msg: &LogMsg)
Low-level log function. This injects log messages directly into the logging thread channel.
This function applies basic formatting depending on the backend:
- For stdout/stderr backend the format is <target> [level] msg.
- For file backend the format is [level] msg and the message is recorded in the file corresponding to the log target.
WARNING: For optimization reasons, this function does not check and thus does neither honor the enabled flag nor the current log level. For a checked log function, use checked_log.
sourcepub fn log(&self, msg: &LogMsg)
pub fn log(&self, msg: &LogMsg)
Main log function. This injects log messages into the logging thread channel only if this logger is enabled.
This function calls the raw_log function only when this logger is enabled.
sourcepub fn filter(&self) -> LevelFilter
pub fn filter(&self) -> LevelFilter
Returns the filter level of this logger instance.
sourcepub fn set_filter(&self, filter: LevelFilter)
pub fn set_filter(&self, filter: LevelFilter)
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true if the logger is currently enabled and is capturing log messages.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Logger
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl !UnwindSafe for Logger
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