Trait slog::Drain [] [src]

pub trait Drain: Send + Sync {
    fn log(&self, buf: &mut Vec<u8>, info: &Record, &OwnedKeyValueList) -> Result<()>;
}

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.

Required Methods

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