From cd95e71acf02fcd41137974122df8d07b8ef6a5e Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Thu, 1 Oct 2026 08:16:43 +0000 Subject: [PATCH] Log which configuration file is loaded This helps debugging. Signed-off-by: Thanos Makatos --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 30f6f85..adef02b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,8 @@ use io_thread_controller::{ util::Path, }; use thiserror::Error; +use tracing::instrument; +use tracing_subscriber::fmt::format::FmtSpan; #[derive(Error, Debug)] enum IoThreadControllerError { @@ -136,6 +138,7 @@ async fn main() -> Result<(), IoThreadControllerError> { } /// Load defaults only for an absent file; propagate every other open failure. +#[instrument] fn load_daemon_config(path: &Path) -> Result { match std::fs::File::open(path) { Ok(_) => load_config(path), @@ -179,6 +182,7 @@ fn init_logging(filter: &str, style: LogStyle) { .with_target(true) .without_time() .with_env_filter(env_filter) + .with_span_events(FmtSpan::NEW) // FIXME elsewhere .finish(); let _ = tracing::subscriber::set_global_default(subscriber); }