Trait Formatter

Source
pub trait Formatter:
    Send
    + Sync
    + DynClone {
    // Required method
    fn format(
        &self,
        record: &Record<'_>,
        dest: &mut StringBuf,
        ctx: &mut FormatterContext<'_>,
    ) -> Result<()>;
}
Expand description

Represents a formatter that can be used for formatting logs.

§Examples

See the implementation of FullFormatter and ./examples directory.

Required Methods§

Source

fn format( &self, record: &Record<'_>, dest: &mut StringBuf, ctx: &mut FormatterContext<'_>, ) -> Result<()>

Formats a log record.

Implementors§

Source§

impl Formatter for FullFormatter

Source§

impl Formatter for JsonFormatter

Available on crate feature serde_json only.
Source§

impl<P> Formatter for PatternFormatter<P>
where P: 'static + Clone + Pattern,