Skip to main content

Scrub

Trait Scrub 

Source
pub trait Scrub:
    Send
    + Sync
    + 'static {
    // Required method
    fn scrub(&self, log: Log) -> Log;
}
Available on crate feature tracing-layer only.
Expand description

Rewrites a record before it leaves the layer: redaction, field filtering, enrichment.

RlgLayer applies it to every log record it builds and to the attributes of every closed span it hands to a SpanSink, so one scrubber covers both paths. Closures Fn(Log) -> Log implement it; so does rlg_redact::Redactor with that crate’s tracing feature.

Required Methods§

Source

fn scrub(&self, log: Log) -> Log

Returns the record to emit in place of log.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Scrub for F
where F: Fn(Log) -> Log + Send + Sync + 'static,