From dd5304f6fc2b4af3556549a3b587f588407dfa71 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 31 Aug 2022 14:24:41 +0200 Subject: Replace logging crate pretty_env_logger by tracing_subscriber::fmt --- src/garage/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/garage/main.rs') diff --git a/src/garage/main.rs b/src/garage/main.rs index 89888884..65abfd48 100644 --- a/src/garage/main.rs +++ b/src/garage/main.rs @@ -59,7 +59,7 @@ async fn main() { if std::env::var("RUST_LOG").is_err() { std::env::set_var("RUST_LOG", "netapp=info,garage=info") } - pretty_env_logger::init(); + tracing_subscriber::fmt::init(); sodiumoxide::init().expect("Unable to init sodiumoxide"); // Abort on panic (same behavior as in Go) -- cgit v1.2.3 From 44cd98d2e4eb981f29c3124c7ab3ddf55ccb3848 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 31 Aug 2022 14:28:17 +0200 Subject: Tracing-subscriber: write to stderr --- src/garage/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/garage/main.rs') diff --git a/src/garage/main.rs b/src/garage/main.rs index 65abfd48..cc441727 100644 --- a/src/garage/main.rs +++ b/src/garage/main.rs @@ -59,7 +59,9 @@ async fn main() { if std::env::var("RUST_LOG").is_err() { std::env::set_var("RUST_LOG", "netapp=info,garage=info") } - tracing_subscriber::fmt::init(); + tracing_subscriber::fmt() + .with_writer(std::io::stderr) + .init(); sodiumoxide::init().expect("Unable to init sodiumoxide"); // Abort on panic (same behavior as in Go) -- cgit v1.2.3 From efbca67ce43891f4cfe696bbd182f6726e8fdc73 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 31 Aug 2022 14:39:12 +0200 Subject: Add env filter to tracing subscriber --- src/garage/main.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/garage/main.rs') diff --git a/src/garage/main.rs b/src/garage/main.rs index cc441727..f6e694f3 100644 --- a/src/garage/main.rs +++ b/src/garage/main.rs @@ -61,6 +61,7 @@ async fn main() { } tracing_subscriber::fmt() .with_writer(std::io::stderr) + .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env()) .init(); sodiumoxide::init().expect("Unable to init sodiumoxide"); -- cgit v1.2.3