fix: Enable systemd feature to correctly initialize logger

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-21 20:40:18 +01:00
parent 838082e95a
commit 2ac14c8d5b
2 changed files with 2 additions and 4 deletions

View file

@ -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"] }

View file

@ -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.");
}