Struct parallel_logger::ParallelLogger
source · pub struct ParallelLogger { /* private fields */ }Expand description
A log::Log implementation that executes all logging on a separate thread.
Simply pass the actual loggers in the call to ParallelLogger::init.
Implementations§
source§impl ParallelLogger
impl ParallelLogger
sourcepub fn init(log_level: LevelFilter, actual_loggers: Vec<Box<dyn Log>>)
pub fn init(log_level: LevelFilter, actual_loggers: Vec<Box<dyn Log>>)
Initializes the ParallelLogger.
This function sets up a new ParallelLogger with the specified log level and the actual loggers.
It starts a new logging thread that listens for log messages on a channel.
The ParallelLogger is then set as the global logger for the log crate.
§Arguments
log_level- The maximum log level that the logger will handle. Log messages with a level higher than this will be ignored. This will also apply to the actual loggers even though those might have a higher log level set in their configs.actual_loggers- The actual loggers that theParallelLoggerwill forward log messages to.
§Panics
If another logger was already set for the log crate,
or if no actual logger was provided, this function panics.
Trait Implementations§
source§impl Debug for ParallelLogger
impl Debug for ParallelLogger
source§impl Drop for ParallelLogger
impl Drop for ParallelLogger
source§impl Log for ParallelLogger
impl Log for ParallelLogger
Auto Trait Implementations§
impl !RefUnwindSafe for ParallelLogger
impl Send for ParallelLogger
impl Sync for ParallelLogger
impl Unpin for ParallelLogger
impl !UnwindSafe for ParallelLogger
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