Sink

Trait Sink 

Source
pub trait Sink:
    SinkPropAccess
    + Sync
    + Send {
    // Required methods
    fn log(&self, record: &Record<'_>) -> Result<()>;
    fn flush(&self) -> Result<()>;

    // Provided method
    fn should_log(&self, level: Level) -> bool { ... }
}
Expand description

Represents a sink

See ./examples directory for how to implement a custom sink.

Required Methods§

Source

fn log(&self, record: &Record<'_>) -> Result<()>

Logs a record.

Source

fn flush(&self) -> Result<()>

Flushes any buffered records.

Provided Methods§

Source

fn should_log(&self, level: Level) -> bool

Determines if a log message with the specified level would be logged.

Implementors§

Source§

impl Sink for AndroidSink

Available on Android and crate feature native and crate feature android-ndk only.
Source§

impl Sink for AsyncPoolSink

Available on crate feature multi-thread only.
Source§

impl Sink for DedupSink

Source§

impl Sink for FileSink

Source§

impl Sink for JournaldSink

Available on Linux and crate feature native and crate feature libsystemd only.
Source§

impl Sink for RotatingFileSink

Source§

impl Sink for StdStreamSink

Source§

impl Sink for WinDebugSink

Available on Windows and crate feature native only.
Source§

impl<W> Sink for WriteSink<W>
where W: Write + Send,