pub trait LogSink: Sync {
// Required method
fn log(&self, record: &Record<'_>);
// Provided methods
fn flush(&self) { ... }
fn reentrant(&self) -> bool { ... }
}Expand description
Backend a log record is delivered to.
Implementations must be Sync so the dispatcher can hold them
in &'static [&dyn LogSink]. ISR-safety is per-impl.
Required Methods§
Provided Methods§
Sourcefn reentrant(&self) -> bool
fn reentrant(&self) -> bool
Whether log may run in several contexts at once:
threads, CPUs and interrupts.
A re-entrant sink gets every record directly, in the context that raised it, so concurrent loggers never queue behind one another for it. A sink that is not (the default) is entered one record at a time behind the process-wide dispatch guard, and a record that finds the guard held waits in the hold queue for it, as before.
Say true only when log is safe concurrently AND never logs
through nros_log itself. A re-entrant sink that does log is not
recursed into without bound: past REENTRANT_DEPTH nested or
concurrent deliveries, a record takes the guarded path for every sink.
Records from different contexts may reach a re-entrant sink
interleaved, in the order they were raised.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".