1pub mod capture;
2pub mod color;
3pub mod console;
4pub mod fmt;
5pub mod fmt_span;
6mod reload;
7mod suppress;
8
9use std::sync::Arc;
10
11pub use tracing::{Level, subscriber::Subscriber};
12pub use tracing_core::{Event, Metadata};
13pub use tracing_subscriber::EnvFilter;
14
15pub use self::{
16 capture::Capture,
17 console::{ConsoleFormat, ConsoleWriter, is_systemd_mode},
18 reload::{LogLevelReloadHandles, ReloadHandle},
19 suppress::Suppress,
20};
21
22pub struct Logging {
26 pub subscriber: Arc<dyn Subscriber + Send + Sync>,
28
29 pub reload: LogLevelReloadHandles,
31
32 pub capture: Arc<capture::State>,
34}
35
36#[macro_export]
42#[collapse_debuginfo(yes)]
43macro_rules! event {
44 ( $level:expr_2021, $($x:tt)+ ) => { ::tracing::event!( $level, $($x)+ ) }
45}
46
47#[macro_export]
48macro_rules! error {
49 ( $($x:tt)+ ) => { ::tracing::error!( $($x)+ ) }
50}
51
52#[macro_export]
53macro_rules! warn {
54 ( $($x:tt)+ ) => { ::tracing::warn!( $($x)+ ) }
55}
56
57#[macro_export]
58macro_rules! info {
59 ( $($x:tt)+ ) => { ::tracing::info!( $($x)+ ) }
60}
61
62#[macro_export]
63macro_rules! debug {
64 ( $($x:tt)+ ) => { ::tracing::debug!( $($x)+ ) }
65}
66
67#[macro_export]
68macro_rules! trace {
69 ( $($x:tt)+ ) => { ::tracing::trace!( $($x)+ ) }
70}