pub struct LoggerBuffer { /* private fields */ }Expand description
A log::Log implementation that stores entries in a bounded ring buffer
and optionally forwards them to an inner logger (e.g. env_logger for
stderr output). The buffer is exposed for in-process consumption by the
log-viewer plugin.
Implementations§
Source§impl LoggerBuffer
impl LoggerBuffer
pub fn new(max_entries: usize) -> Self
Sourcepub fn set_inner(&mut self, inner: Box<dyn Log + Send + 'static>)
pub fn set_inner(&mut self, inner: Box<dyn Log + Send + 'static>)
Set an inner logger that every record is forwarded to in addition to the ring buffer. Call before installing as the global logger.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LoggerBuffer
impl !RefUnwindSafe for LoggerBuffer
impl !UnwindSafe for LoggerBuffer
impl Send for LoggerBuffer
impl Sync for LoggerBuffer
impl Unpin for LoggerBuffer
impl UnsafeUnpin for LoggerBuffer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more