From 66a2632e2ee72a1e3a9888cd5638821f6af2f861 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 22 Aug 2025 14:40:03 -0700 Subject: [PATCH] fix(cosmic-config): Fixes for error printing * Use `tracing::error!` in places where `eprintln!` was used * Loop over errors and print seperately * Print errors with `Display` rather than `Debug` * Don't print errors that should be ignored - Matches https://github.com/pop-os/libcosmic/pull/949, for same reasons. With this, and the previous change, cosmic-panel no longer spams a bunch of config errors from different applets on start. --- cosmic-config/src/dbus.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cosmic-config/src/dbus.rs b/cosmic-config/src/dbus.rs index e66d8556..f8256bc3 100644 --- a/cosmic-config/src/dbus.rs +++ b/cosmic-config/src/dbus.rs @@ -156,8 +156,16 @@ fn watcher_stream config, Err((errors, default)) => { - if !errors.is_empty() { - eprintln!("Error getting config: {config_id} {errors:?}"); + for why in &errors { + if why.is_err() { + if let crate::Error::GetKey(_, err) = &why { + if err.kind() == std::io::ErrorKind::NotFound { + // No system default config installed; don't error + continue; + } + } + tracing::error!("error getting config: {config_id} {why}"); + } } default } @@ -171,7 +179,7 @@ fn watcher_stream