From 6921d10db22eaaa6c54dc2664eda5f425aab9ba5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 22 Aug 2022 12:31:20 -0400 Subject: [PATCH] subscriber: say which crate the disabled level warning refers to (#2285) I just saw this warning when trying to debug something in Miri: ``` warning: some trace filter directives would enable traces that are disabled statically | `miri::tls=trace` would enable the TRACE level for the `miri::tls` target = note: the static max level is `info` = help: to enable DEBUG logging, remove the `max_level_info` feature ``` I spent 10min figuring out why the `log` crate is doing this (Miri is using env-logger for logging), until I realized that this error actually originates from inside rustc, which I guess uses `tracing`. It would have helped if the error message would say which crate is even talking to me here. :) --- tracing-subscriber/src/filter/env/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing-subscriber/src/filter/env/builder.rs b/tracing-subscriber/src/filter/env/builder.rs index 7bc65484ea..f776f1f18e 100644 --- a/tracing-subscriber/src/filter/env/builder.rs +++ b/tracing-subscriber/src/filter/env/builder.rs @@ -282,7 +282,7 @@ impl Builder { }; let (feature, earlier_level) = help_msg(); ctx_help(&format!( - "to enable {}logging, remove the `{}` feature", + "to enable {}logging, remove the `{}` feature from the `tracing` crate", earlier_level, feature )); }