@@ -599,7 +599,7 @@ fn init_logging(level: &str, log_file: Option<&std::path::Path>) {
|
|||||||
.file_stem()
|
.file_stem()
|
||||||
.and_then(|s| s.to_str())
|
.and_then(|s| s.to_str())
|
||||||
.unwrap_or("daemon");
|
.unwrap_or("daemon");
|
||||||
|
|
||||||
let file_appender = tracing_appender::rolling::RollingFileAppender::builder()
|
let file_appender = tracing_appender::rolling::RollingFileAppender::builder()
|
||||||
.rotation(tracing_appender::rolling::Rotation::DAILY)
|
.rotation(tracing_appender::rolling::Rotation::DAILY)
|
||||||
.filename_prefix(prefix)
|
.filename_prefix(prefix)
|
||||||
@@ -608,7 +608,7 @@ fn init_logging(level: &str, log_file: Option<&std::path::Path>) {
|
|||||||
.expect("Failed to create log file appender");
|
.expect("Failed to create log file appender");
|
||||||
|
|
||||||
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
|
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
|
||||||
|
|
||||||
// Store the guard to prevent it from being dropped
|
// Store the guard to prevent it from being dropped
|
||||||
// We leak it intentionally to keep logging working for the daemon's lifetime
|
// We leak it intentionally to keep logging working for the daemon's lifetime
|
||||||
std::mem::forget(_guard);
|
std::mem::forget(_guard);
|
||||||
|
|||||||
Reference in New Issue
Block a user