pub struct LogDispatcher { /* private fields */ }Expand description
Thread-safe fan-out dispatcher; ordinary sinks receive only sanitized events.
Implementations§
Source§impl LogDispatcher
impl LogDispatcher
Sourcepub fn new(policy: LogPolicy, sinks: Vec<Arc<dyn LogSink>>) -> LogDispatcher
pub fn new(policy: LogPolicy, sinks: Vec<Arc<dyn LogSink>>) -> LogDispatcher
Creates a dispatcher with explicit filtering and sinks.
Sourcepub fn emit(&self, event: LogEvent)
pub fn emit(&self, event: LogEvent)
Emits once. Critical failure accounting is retained even when a sink fails.
Sourcepub fn event<'a>(
&'a self,
timestamp_ms: u64,
component: impl Into<Cow<'a, str>>,
) -> LogBuilder<'a>
pub fn event<'a>( &'a self, timestamp_ms: u64, component: impl Into<Cow<'a, str>>, ) -> LogBuilder<'a>
Creates a fluent event builder for a stable component and clock value.
Sourcepub fn event_now<'a>(
&'a self,
clock: &dyn LogClock,
component: impl Into<Cow<'a, str>>,
) -> LogBuilder<'a>
pub fn event_now<'a>( &'a self, clock: &dyn LogClock, component: impl Into<Cow<'a, str>>, ) -> LogBuilder<'a>
Creates a fluent event builder using an injected clock.
Sourcepub fn enabled(&self, component: &str, verbosity: Verbosity) -> bool
pub fn enabled(&self, component: &str, verbosity: Verbosity) -> bool
Reports whether a component and verbosity would reach at least one sink.
Sourcepub fn sink_stats(&self) -> Vec<SinkStats>
pub fn sink_stats(&self) -> Vec<SinkStats>
Returns bounded failure counters for each configured sink.
Auto Trait Implementations§
impl !Freeze for LogDispatcher
impl !RefUnwindSafe for LogDispatcher
impl !UnwindSafe for LogDispatcher
impl Send for LogDispatcher
impl Sync for LogDispatcher
impl Unpin for LogDispatcher
impl UnsafeUnpin for LogDispatcher
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