Struct indicatif_log_bridge::LogWrapper
source · pub struct LogWrapper<L: Log> { /* private fields */ }
Expand description
Wraps a MultiProgress and a Log implementor, calling .suspend on the MultiProgress while writing the log message, thereby preventing progress bars and logs from getting mixed up.
You simply have to add every ProgressBar to the passed MultiProgress.
Implementations§
source§impl<L: Log + 'static> LogWrapper<L>
impl<L: Log + 'static> LogWrapper<L>
pub fn new(bar: MultiProgress, log: L) -> Self
sourcepub fn try_init(self) -> Result<(), SetLoggerError>
pub fn try_init(self) -> Result<(), SetLoggerError>
Installs this as the global logger.
Tries to find the correct argument to log::set_max_level by reading the logger configuration, you may want to set it manually though. For more details read the known issues.
pub fn multi(&self) -> MultiProgress
Trait Implementations§
source§impl<L: Log> Log for LogWrapper<L>
impl<L: Log> Log for LogWrapper<L>
Auto Trait Implementations§
impl<L> Freeze for LogWrapper<L>where
L: Freeze,
impl<L> RefUnwindSafe for LogWrapper<L>where
L: RefUnwindSafe,
impl<L> Send for LogWrapper<L>
impl<L> Sync for LogWrapper<L>
impl<L> Unpin for LogWrapper<L>where
L: Unpin,
impl<L> UnwindSafe for LogWrapper<L>where
L: UnwindSafe,
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