pub trait Writer {
    // Required method
    fn write_log(
        &self,
        value: &BTreeMap<Key<'_>, Value<'_>>
    ) -> Result<(), Error>;
}
Expand description

A trait that defines how to write a log. You can implement this trait for your custom formatting and writing destination.

Implementation examples:

Required Methods§

source

fn write_log(&self, value: &BTreeMap<Key<'_>, Value<'_>>) -> Result<(), Error>

Writes a structured log to the underlying io::Write instance.

Implementors§

source§

impl<W: Write + Sync + Send + 'static> Writer for JSONWriter<W>

Implements Writer trait for JSONWriter.

source§

impl<W: AsyncWrite + Sync + Send + 'static> Writer for AsyncJSONWriter<W>

Implements Writer trait for AsyncJSONWriter.