From 4420db731020bf7123f2bb80b076da581836f900 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 18 May 2023 00:07:54 +0200 Subject: add tracing to k2v-client --- src/k2v-client/bin/k2v-cli.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/k2v-client/bin') diff --git a/src/k2v-client/bin/k2v-cli.rs b/src/k2v-client/bin/k2v-cli.rs index 76388752..984b4192 100644 --- a/src/k2v-client/bin/k2v-cli.rs +++ b/src/k2v-client/bin/k2v-cli.rs @@ -397,6 +397,15 @@ impl Filter { #[tokio::main] async fn main() -> Result<(), Error> { + if std::env::var("RUST_LOG").is_err() { + std::env::set_var("RUST_LOG", "warn") + } + + tracing_subscriber::fmt() + .with_writer(std::io::stderr) + .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env()) + .init(); + let args = Args::parse(); let region = Region::Custom { -- cgit v1.2.3