Struct slog::Fuse
[−]
[src]
pub struct Fuse<D: Drain> { // some fields omitted }
Panicking fuse
Logger
requires a root drain to handle all errors (Drain::Error == ()
),
Fuse
will wrap a Drain
and panic if it returns any errors.
Note: Drain::Error
must implement Display
. It's easy to create own
Fuse
drain if this requirement can't be fulfilled.
Methods
impl<D: Drain> Fuse<D>
[src]
fn new(drain: D) -> Self
Create Fuse wrapping given subdrain
Trait Implementations
impl<D: Drain> Drain for Fuse<D> where D::Error: Display
[src]
type Error = ()
Type of potential error returned during logging
fn log(&self, info: &Record, logger_values: &OwnedKeyValueList) -> Result<(), ()>
Write one logging record As an optimization (avoiding allocations), loggers are responsible for providing a byte buffer, that Drain
can use for their own needs. Read more