Append

Trait Append 

Source
pub trait Append:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn append(
        &self,
        record: &Record<'_>,
        diags: &[Box<dyn Diagnostic>],
    ) -> Result<(), Error>;
    fn flush(&self) -> Result<(), Error>;

    // Provided method
    fn exit(&self) -> Result<(), Error> { ... }
}
Expand description

An appender that can process log records.

Required Methods§

Source

fn append( &self, record: &Record<'_>, diags: &[Box<dyn Diagnostic>], ) -> Result<(), Error>

Dispatch a log record to the append target.

Source

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

Flush any buffered records.

Provided Methods§

Source

fn exit(&self) -> Result<(), Error>

Perform any cleanup work before the program exits.

Default to call flush.

This is typically called within a global logger during program exits. If it is not in a global logger, the drop glue should perform necessary cleanup.

Trait Implementations§

Source§

impl<T: Append> From<T> for Box<dyn Append>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.

Implementors§