rdkafka/
log.rs

1//! A wrapper module to export logging functionality from
2//! [`log`] or [`tracing`] depending on the `tracing` feature.
3//!
4//! [`log`]: https://docs.rs/log
5//! [`tracing`]: https://docs.rs/tracing
6
7#[cfg(not(feature = "tracing"))]
8pub use log::Level::{Debug as DEBUG, Info as INFO, Warn as WARN};
9#[cfg(not(feature = "tracing"))]
10pub use log::{debug, error, info, log_enabled, trace, warn};
11
12#[cfg(feature = "tracing")]
13pub use tracing::{debug, enabled as log_enabled, error, info, trace, warn};
14#[cfg(feature = "tracing")]
15pub const DEBUG: tracing::Level = tracing::Level::DEBUG;
16#[cfg(feature = "tracing")]
17pub const INFO: tracing::Level = tracing::Level::INFO;
18#[cfg(feature = "tracing")]
19pub const WARN: tracing::Level = tracing::Level::WARN;