|
@@ -164,6 +164,7 @@ macro_rules! async_daemonize {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ let mut _file_guard = None;
|
|
|
// If a log file has been configured, create a terminal and file logger.
|
|
// If a log file has been configured, create a terminal and file logger.
|
|
|
// Otherwise, output to terminal logger only.
|
|
// Otherwise, output to terminal logger only.
|
|
|
match args.log {
|
|
match args.log {
|
|
@@ -184,7 +185,8 @@ macro_rules! async_daemonize {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// hold guard until process stops to ensure buffer logs are flushed to file
|
|
// hold guard until process stops to ensure buffer logs are flushed to file
|
|
|
- let (non_blocking, _guard) = tracing_appender::non_blocking(log_file);
|
|
|
|
|
|
|
+ let (non_blocking, guard) = tracing_appender::non_blocking(log_file);
|
|
|
|
|
+ _file_guard = Some(guard);
|
|
|
if let Err(e) =
|
|
if let Err(e) =
|
|
|
darkfi::util::logger::setup_logging(args.verbose, Some(non_blocking))
|
|
darkfi::util::logger::setup_logging(args.verbose, Some(non_blocking))
|
|
|
{
|
|
{
|