From 2ac14c8d5b52c978a5fdf31411fec77cc37afff0 Mon Sep 17 00:00:00 2001 From: John Rogers Date: Mon, 21 Jul 2025 20:40:18 +0100 Subject: [PATCH] fix: Enable systemd feature to correctly initialize logger Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) --- Cargo.toml | 2 +- src/main.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05673af..25cef14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,5 +20,5 @@ clap = { version = "4.4", features = ["derive"] } log = "0.4" [target.'cfg(target_os = "linux")'.dependencies] -systemd-journal-logger = "1.0" +systemd-journal-logger = { version = "1.0", features = ["systemd"] } diff --git a/src/main.rs b/src/main.rs index f588001..652e1b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,9 +105,7 @@ async fn main() { println!("🚀 Starting TimeTurner daemon..."); #[cfg(target_os = "linux")] { - // Manually initialize the logger as a workaround for build issues. - let logger = systemd_journal_logger::JournalLog::new().unwrap(); - log::set_boxed_logger(Box::new(logger)).unwrap(); + systemd_journal_logger::init().unwrap(); log::set_max_level(log::LevelFilter::Info); log::info!("TimeTurner daemon started. API server is running."); }