Trait Formatter

Source
pub trait Formatter {
    // Provided methods
    fn format(&self, _: Entry) { ... }
    fn format_mut(&mut self, entry: Entry) { ... }
}
Expand description

This allows the definition of a custom format closure. The trait provides both immutable and mutable logging methods for different scenarios. For instance, Iron middleware does not allow mutability in the handlers, and so a logging middleware must be immutable. This effectively means that for Iron, logging can only go to stdout.

Other systems may allow mutable logging, which allows for a Formatter that records to a file or to an internal data structure.

Provided Methods§

Source

fn format(&self, _: Entry)

Source

fn format_mut(&mut self, entry: Entry)

Implementors§

Source§

impl<F> Formatter for F
where F: Fn(Entry),