fix: Conditionally compile systemd features for Linux only

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 19:46:16 +01:00
parent b854d29015
commit 12065a08c2
4 changed files with 52 additions and 20 deletions

View file

@ -103,9 +103,16 @@ async fn main() {
});
} else {
println!("🚀 Starting TimeTurner daemon...");
systemd_journal_logger::init().unwrap();
log::set_max_level(log::LevelFilter::Info);
log::info!("TimeTurner daemon started. API server is running.");
#[cfg(target_os = "linux")]
{
systemd_journal_logger::init().unwrap();
log::set_max_level(log::LevelFilter::Info);
log::info!("TimeTurner daemon started. API server is running.");
}
#[cfg(not(target_os = "linux"))]
{
println!("Daemon mode started. API server is running. Logging to system journal is only supported on Linux.");
}
}
// 6⃣ Set up a LocalSet for the API server and main loop