Skip to main content

CommandObserver

Trait CommandObserver 

Source
pub trait CommandObserver: Send + Sync {
    // Required method
    fn on_command(&self, record: &CommandRecord<'_>);
}
Expand description

A sink for the command records a LoggingRunner produces. Implement it to route the (already-redacted) CommandRecord into tracing, a file, a metrics counter, or a test buffer; the built-in StderrObserver writes a one-line summary to stderr.

Required Methods§

Source

fn on_command(&self, record: &CommandRecord<'_>)

Called once per observed command, synchronously, after it finishes (or, for a streaming ProcessRunner::start, right after the handle is returned). Keep it cheap and non-blocking; it runs on the calling task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§