rs-rich-ext 0.0.21

Extensions for the `rich` Rust port: diagnostics, structured data, clap and tracing integration, diffs, workflow renderables and a plugin registry
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Facade adapters with explicit ownership; no global installation.
//! [`EventSink`] is always here; `LogAdapter` needs the `log` feature and
//! `EventLayer` the `tracing` feature.
use crate::event::StructuredEvent;
/// Where an adapter sends each event: a `RichHandler`, a
/// [`ChannelSink`](crate::log_stream::ChannelSink), a file, a test buffer.
pub trait EventSink: Send + Sync {
    fn emit(&self, event: StructuredEvent) -> std::io::Result<()>;
}
#[cfg(feature = "log")]
mod log;
#[cfg(feature = "log")]
pub use log::LogAdapter;
#[cfg(feature = "tracing")]
mod tracing;
#[cfg(feature = "tracing")]
pub use tracing::EventLayer;