p4bl0t/src/utils.rs

16 lines
406 B
Rust
Raw Normal View History

2023-11-22 21:38:21 +01:00
use tracing::Level;
use tracing_subscriber::FmtSubscriber;
/// Initialize logging for the project.
///
/// # Panics
///
/// Panics if the logger fails to initialize.
2023-11-22 21:38:21 +01:00
pub fn setup_logging() {
let subscriber = FmtSubscriber::builder()
.with_max_level(Level::INFO)
2023-11-22 21:38:21 +01:00
.finish();
tracing::subscriber::set_global_default(subscriber)
.expect("Setting default subscriber failed");
}