mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
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:
parent
838082e95a
commit
2ac14c8d5b
2 changed files with 2 additions and 4 deletions
|
|
@ -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"] }
|
||||
|
||||
|
|
|
|||
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue