testkit-core 0.1.1

Core utilities for testkit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Tracing utilities for the library

// Re-export the external tracing crate
pub use ::tracing::*;

/// Initialize tracing for the application.
/// Only initializes if RUST_ENV is set to "DEBUG"
pub fn init_tracing() {
    // Only initialize tracing if RUST_ENV is set to "DEBUG"
    if let Ok(env) = std::env::var("RUST_ENV") {
        if env.to_lowercase() == "debug" {
            let _ = ::tracing_subscriber::fmt::try_init();
        }
    }
}