Trait slog::drain::Drain
[−]
[src]
pub trait Drain: Send + Sync { fn log(&self, buf: &mut Vec<u8>, info: &RecordInfo, &OwnedKeyValueNode) -> Result<()>; }
Drain for Loggers
Implementing this trait allows writing own Drains
Required Methods
fn log(&self, buf: &mut Vec<u8>, info: &RecordInfo, &OwnedKeyValueNode) -> Result<()>
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> Drain for Box<D>
impl<D: Drain> Drain for Arc<D>
impl Drain for Discard
impl Drain for AtomicSwitch
impl<W: 'static + Write + Send, F: Format + Send> Drain for Streamer<W, F>
impl<F: Format + Send> Drain for AsyncStreamer<F>
impl<D: Drain> Drain for Filter<D>
impl<D: Drain> Drain for FilterLevel<D>
impl<D1: Drain, D2: Drain> Drain for Duplicate<D1, D2>
impl<D1: Drain, D2: Drain> Drain for Failover<D1, D2>