Struct slog::Filter
[−]
[src]
pub struct Filter<D: Drain> { // some fields omitted }
Drain filtering records
Wraps a Drain
and passes Record
-s to it, only if they satisifies a
condition cond
.
Methods
impl<D: Drain> Filter<D>
[src]
fn new<F: 'static + Sync + Send + Fn(&Record) -> bool>(drain: D, cond: F) -> Self
Create Filter wrapping given subdrain
and passing to it records
only the cond
is true
Trait Implementations
impl<D: Drain> Drain for Filter<D>
[src]
type Error = D::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