Struct slog::Failover
[−]
[src]
pub struct Failover<D1: Drain, D2: Drain> { // some fields omitted }
Failover drain
Log everything to logger D1
, but in case of it reporting error,
try logging to D2
. If it also returned an error, forward it up.
Methods
impl<D1: Drain, D2: Drain> Failover<D1, D2>
[src]
fn new(drain1: D1, drain2: D2) -> Self
Create Failover
Trait Implementations
impl<D1, D2, E1, E2> Drain for Failover<D1, D2> where D1: Drain<Error=E1>, D2: Drain<Error=E2>
[src]
type Error = D2::Error
Type of potential error returned during logging
fn log(&self, info: &Record, logger_values: &OwnedKeyValueList) -> Result<(), Self::Error>
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