mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-03 06:22:32 -05:00
switch from log to tracing
I think this is a big improvement in readability. I removed the `lnav` config, which is a little sad, but I don't think it supports this structured logging format well. Still seems worthwhile on balance.
This commit is contained in:
@@ -16,9 +16,9 @@ path = "lib.rs"
|
||||
failure = "0.1.1"
|
||||
futures = "0.3"
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
nom = "7.0.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
slab = "0.4"
|
||||
time = "0.1"
|
||||
tracing = "0.1.37"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
//! Clock interface and implementations for testability.
|
||||
|
||||
use failure::Error;
|
||||
use log::warn;
|
||||
use std::mem;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::{mpsc, Arc};
|
||||
use std::thread;
|
||||
use std::time::Duration as StdDuration;
|
||||
use time::{Duration, Timespec};
|
||||
use tracing::warn;
|
||||
|
||||
use crate::shutdown::ShutdownError;
|
||||
|
||||
@@ -54,9 +54,8 @@ where
|
||||
shutdown_rx.check()?;
|
||||
let sleep_time = Duration::seconds(1);
|
||||
warn!(
|
||||
"sleeping for {} after error: {}",
|
||||
sleep_time,
|
||||
crate::error::prettify_failure(&e)
|
||||
err = crate::error::prettify_failure(&e),
|
||||
"sleeping for 1 s after error"
|
||||
);
|
||||
clocks.sleep(sleep_time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user