Struct rustwide::logging::LogStorage
source · pub struct LogStorage { /* private fields */ }
Expand description
Store logs captured by capture
and retrieve them later.
The storage can have a maximum size and line limit, to prevent unbounded logging from exausting
system memory. It can be used from multiple threads at the same time. To output the stored log
entries you can call the to_string()
method, which will return a string representation of
them.
Implementations§
source§impl LogStorage
impl LogStorage
sourcepub fn new(min_level: LevelFilter) -> Self
pub fn new(min_level: LevelFilter) -> Self
Create a new log storage.
sourcepub fn set_max_size(&mut self, size: usize)
pub fn set_max_size(&mut self, size: usize)
Set the maximum amount of bytes stored in this struct before truncating the output.
sourcepub fn set_max_lines(&mut self, lines: usize)
pub fn set_max_lines(&mut self, lines: usize)
Set the maximum amount of lines stored in this struct before truncating the output.
sourcepub fn duplicate(&self) -> LogStorage
pub fn duplicate(&self) -> LogStorage
Duplicate the log storage, returning a new, unrelated storage with the same content and configuration.
Trait Implementations§
source§impl Clone for LogStorage
impl Clone for LogStorage
source§fn clone(&self) -> LogStorage
fn clone(&self) -> LogStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for LogStorage
impl Send for LogStorage
impl Sync for LogStorage
impl Unpin for LogStorage
impl UnwindSafe for LogStorage
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