testkit_core/
tracing.rs

1//! Tracing utilities for the library
2
3// Re-export the external tracing crate
4pub use ::tracing::*;
5
6/// Initialize tracing for the application.
7/// Only initializes if RUST_ENV is set to "DEBUG"
8pub fn init_tracing() {
9    // Only initialize tracing if RUST_ENV is set to "DEBUG"
10    if let Ok(env) = std::env::var("RUST_ENV") {
11        if env.to_lowercase() == "debug" {
12            let _ = ::tracing_subscriber::fmt::try_init();
13        }
14    }
15}