diff options
author | Alex Auvolat <alex@adnab.me> | 2023-05-18 00:07:54 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-05-18 11:18:21 +0200 |
commit | 4420db731020bf7123f2bb80b076da581836f900 (patch) | |
tree | 103270ccca9d9a26c220fce528b9a3c397fb2703 /src/k2v-client/bin | |
parent | 746b0090e4ad02e98b08aa1cfefd77a22d9490fe (diff) | |
download | garage-4420db731020bf7123f2bb80b076da581836f900.tar.gz garage-4420db731020bf7123f2bb80b076da581836f900.zip |
add tracing to k2v-client
Diffstat (limited to 'src/k2v-client/bin')
-rw-r--r-- | src/k2v-client/bin/k2v-cli.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |