cosmian_logger/lib.rs
1//! # Cosmian Logger
2//!
3//! A flexible logging crate that supports both synchronous and asynchronous
4//! environments.
5//!
6//! ## Features
7//!
8//! - `full`: Enables complete functionality including tokio/async support,
9//! OpenTelemetry integration, and syslog support
10//! - Without `full`: Provides basic tracing functionality for synchronous
11//! applications
12//!
13//! ## Important Note
14//!
15//! If you need `TelemetryConfig` or full OpenTelemetry functionality, you must
16//! enable the `full` feature:
17//!
18//! ```toml
19//! [dependencies]
20//! cosmian_logger = { version = "0.6.0", features = ["full"] }
21//! ```
22//!
23//! If you get an error like "no `TelemetryConfig` in the root", it means you
24//! need to enable the full feature in your Cargo.toml dependency declaration.
25mod error;
26mod log_utils;
27mod macros;
28#[cfg(feature = "full")]
29mod otlp;
30mod tracing;
31
32pub use error::LoggerError;
33pub use log_utils::log_init;
34#[cfg(feature = "full")]
35pub use tracing::TelemetryConfig;
36pub use tracing::{tracing_init, LoggingGuards, TracingConfig};
37
38/// Re-exported dependencies for use with the logging macros
39///
40/// The logging macros (info!, debug!, warn!, error!, trace!) use these
41/// re-exported tracing modules internally, so external crates don't need to add
42/// tracing as a direct dependency.
43pub mod reexport {
44 pub use tracing;
45 pub use tracing_subscriber;
46}