Skip to content

Commit 0326ea8

Browse files
committed
Set internal default log level to ERROR
1 parent d0f969c commit 0326ea8

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

Cargo.lock

Lines changed: 31 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ regex = "1.11.1"
1414
serde = { version = "1.0.209", features = [ "derive" ] }
1515
tinytemplate = "1.2.1"
1616
tracing = "0.1.40"
17-
tracing-subscriber = "0.3.18"
17+
tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] }
1818

1919
[build-dependencies]

src/main.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use owo_colors::OwoColorize;
44
use std::io::IsTerminal;
55
use std::path::Path;
66
use tracing::debug;
7-
use tracing_subscriber;
7+
use tracing_subscriber::{self, EnvFilter};
88

99
use technique::formatting::*;
1010
use technique::formatting::{self};
@@ -21,8 +21,12 @@ enum Output {
2121
fn main() {
2222
const VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION"));
2323

24-
// Initialize the tracing subscriber
25-
tracing_subscriber::fmt::init();
24+
// Initialize the tracing subscriber. This respects the RUST_LOG
25+
// environment variable if present, or sets Level::ERROR as a fallback.
26+
let filter = EnvFilter::from_default_env();
27+
tracing_subscriber::fmt()
28+
.with_env_filter(filter)
29+
.init();
2630

2731
let matches = Command::new("technique")
2832
.version(VERSION)

0 commit comments

Comments
 (0)