We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 358e21e commit 401033cCopy full SHA for 401033c
src/librustc_driver/lib.rs
@@ -1233,6 +1233,12 @@ pub fn init_rustc_env_logger() {
1233
/// log crate version. In contrast to `init_rustc_env_logger` it allows you to choose an env var
1234
/// other than `RUSTC_LOG`.
1235
pub fn init_env_logger(env: &str) {
1236
+ // Don't register a dispatcher if there's no filter to print anything
1237
+ match std::env::var(env) {
1238
+ Err(_) => return,
1239
+ Ok(s) if s.is_empty() => return,
1240
+ Ok(_) => {}
1241
+ }
1242
let builder = tracing_subscriber::FmtSubscriber::builder();
1243
1244
let builder = builder.with_env_filter(tracing_subscriber::EnvFilter::from_env(env));
0 commit comments