pub struct LogCollector { /* private fields */ }Expand description
Handle to the buffered log collector. Cheap to clone; all clones share the same backing buffer and reload handle.
Implementations§
Source§impl LogCollector
impl LogCollector
Sourcepub fn drain(&self, max: usize) -> (Vec<LogLine>, u32)
pub fn drain(&self, max: usize) -> (Vec<LogLine>, u32)
Drains up to max lines from the buffer, along with the count of lines
dropped since the last drain.
Sourcepub fn set_filter(
&self,
directives: &str,
expires_in: Option<Duration>,
revert_to: Option<&str>,
) -> Result<(), SetFilterError>
pub fn set_filter( &self, directives: &str, expires_in: Option<Duration>, revert_to: Option<&str>, ) -> Result<(), SetFilterError>
Sets the active filter directives. When expires_in is set,
schedules a revert after that duration. The revert target is
revert_to when supplied; None means revert to off.
Trait Implementations§
Source§impl Clone for LogCollector
impl Clone for LogCollector
Source§fn clone(&self) -> LogCollector
fn clone(&self) -> LogCollector
Returns a duplicate 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 Freeze for LogCollector
impl RefUnwindSafe for LogCollector
impl Send for LogCollector
impl Sync for LogCollector
impl Unpin for LogCollector
impl UnwindSafe for LogCollector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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