Trait slog::Drain
[−]
[src]
pub trait Drain: Send + Sync { type Error; fn log(&self, info: &Record, &OwnedKeyValueList) -> Result<(), Self::Error>; }
Logging drain
Drains generally mean destination for logs, but slog generalize the
term. Drain
-s are responsible for filtering, formatting and writing the
log records into given destination.
Implementing this trait allows writing own Drains, that can be combined with other drains.
Associated Types
type Error
Type of potential error returned during logging
Required Methods
fn log(&self, info: &Record, &OwnedKeyValueList) -> Result<(), Self::Error>
Write one logging record
As an optimization (avoiding allocations), loggers are responsible for
providing a byte buffer, that Drain
can use for their own needs.
Implementors
impl<D: Drain + ?Sized> Drain for Box<D>
impl<D: Drain + ?Sized> Drain for Arc<D>
impl Drain for Discard
impl<D: Drain> Drain for Filter<D>
impl<D: Drain, E> Drain for MapError<D, E>
impl<D: Drain> Drain for LevelFilter<D>
impl<D1: Drain, D2: Drain> Drain for Duplicate<D1, D2>
impl<D1, D2, E1, E2> Drain for Failover<D1, D2> where D1: Drain<Error=E1>, D2: Drain<Error=E2>
impl<D: Drain> Drain for Fuse<D> where D::Error: Display
impl<D: Drain> Drain for IgnoreErr<D>