2023-11-22 21:38:21 +01:00
|
|
|
use tracing::Level;
|
|
|
|
use tracing_subscriber::FmtSubscriber;
|
|
|
|
|
2023-11-25 22:01:02 +01:00
|
|
|
/// 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()
|
2023-11-23 02:09:45 +01:00
|
|
|
.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");
|
|
|
|
}
|