mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
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:
parent
b854d29015
commit
12065a08c2
4 changed files with 52 additions and 20 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue