summaryrefslogtreecommitdiff
path: root/src/logger.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-08-20 17:50:24 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-08-20 17:50:24 +0200
commit3c8b004d6ecb6764cd5bc935aaeaf884040320ab (patch)
treeaf968fb3c598dde61edbe7c87de665f14a0be028 /src/logger.rs
Init
Diffstat (limited to 'src/logger.rs')
-rw-r--r--src/logger.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/logger.rs b/src/logger.rs
new file mode 100644
index 0000000..3f3ff0f
--- /dev/null
+++ b/src/logger.rs
@@ -0,0 +1,11 @@
+use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
+
+/// Setup tracing subscriber logger
+pub fn setup() {
+ tracing_subscriber::registry()
+ .with(tracing_subscriber::EnvFilter::new(
+ crate::config::CONFIG.rust_log.clone(),
+ ))
+ .with(tracing_subscriber::fmt::layer())
+ .init();
+}