Skip to main content

hexz_common/
logging.rs

1//! Logging Infrastructure Initialization.
2//!
3//! This module handles the setup of the application's logging infrastructure.
4//! It configures the tracing subscriber to output structured logs to the console,
5//! enabling observability for debugging and operational monitoring.
6
7/// Initializes the global tracing subscriber.
8///
9/// This function sets up the default logging output format and level filter.
10/// It must be called once at the start of the application (e.g., in `main`)
11/// to ensure that log events from libraries and the application itself are
12/// captured and displayed. The subscriber uses the default format which
13/// includes timestamps, log levels, and message content.
14///
15/// # Panics
16///
17/// This function may panic if the tracing subscriber has already been initialized,
18/// as Rust's tracing system only allows a single global subscriber.
19pub fn init() {
20    tracing_subscriber::fmt::init();
21}