fix(log): demote zbus/tracing D-Bus dumps out of the default filter

zbus 5 logs every dispatched/read D-Bus message as a multi-KB Debug
dump at INFO (through the tracing-log bridge, which also emits
tracing::span events). With any MPRIS applet polling GetAll this
flooded the file sink within ~1s of startup and drowned everything
else — both #555 field logs confirmed it (one diagnostics upload
covered exactly one second of runtime). Filtered records now cost
nothing (log! checks the level before formatting). RUST_LOG still
replaces the whole default, so full zbus tracing stays available.

cc
This commit is contained in:
vicrodh committed 2026-07-07 06:48:23 -06:00
1 parent cb48e04395
commit 8581d39585
1 file changed
+11 -3
+11 -3
View File
@@ -21,9 +21,17 @@ pub fn install(default_level: &str) {
return;
}
let inner = env_logger::Builder::from_env(
env_logger::Env::default().default_filter_or(default_level),
)
// Demote chatty foreign crates in the DEFAULT filter: zbus 5 logs every
// D-Bus message it dispatches/reads as multi-KB Debug dumps at INFO (via
// the tracing-log bridge, which also emits `tracing::span` events). On a
// desktop with an MPRIS applet polling GetAll this flooded the file sink
// within ~1s of startup and drowned real entries (field-confirmed twice
// in #555 logs) — and each suppressed record now costs nothing, since
// `log!` checks the filter before formatting. An explicit RUST_LOG still
// replaces the whole default, so full zbus tracing stays one env var away.
let inner = env_logger::Builder::from_env(env_logger::Env::default().default_filter_or(
format!("{default_level},zbus=warn,tracing=warn"),
))
.build();
let level = inner.filter();
let file = open_log_file();