Skip to content

Commit 2da6cc5

Browse files
committed
subscriber: use INFO as the default log level in EnvFilter
The previous implementation would fall back to "NOTHING" instead, which was a poor default. Close #735
1 parent f8be43b commit 2da6cc5

File tree

1 file changed

+3
-1
lines changed
  • tracing-subscriber/src/filter/env

1 file changed

+3
-1
lines changed

tracing-subscriber/src/filter/env/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ impl EnvFilter {
250250
use tracing::level_filters::STATIC_MAX_LEVEL;
251251
use tracing::Level;
252252

253-
let directives: Vec<_> = directives.into_iter().collect();
253+
let fallback_level = Directive::from(crate::fmt::Subscriber::DEFAULT_MAX_LEVEL);
254+
255+
let directives: Vec<_> = std::iter::once(fallback_level).chain(directives.into_iter()).collect();
254256

255257
let disabled: Vec<_> = directives
256258
.iter()

0 commit comments

Comments
 (0)