diff --git a/src/utils/controller.rs b/src/utils/controller.rs index 8e4b44a3..50add407 100644 --- a/src/utils/controller.rs +++ b/src/utils/controller.rs @@ -134,7 +134,7 @@ impl ProcessControl { rpc.clone().close() }; - for unit in [Encoder, Decoder, Ingest] { + for unit in [Decoder, Encoder, Ingest] { if let Err(e) = self.kill(unit) { error!("{e}") } diff --git a/src/utils/logging.rs b/src/utils/logging.rs index 102d6d45..0f14617e 100644 --- a/src/utils/logging.rs +++ b/src/utils/logging.rs @@ -169,7 +169,7 @@ pub fn init_logging() -> Vec> { let file_config = log_config .clone() .set_time_format_custom(format_description!( - "[[year]-[month]-[day] [hour]:[minute]:[second].[subsecond digits:5]]" + "[[[year]-[month]-[day] [hour]:[minute]:[second].[subsecond digits:5]]" )) .build(); let mut log_path = "logs/ffplayout.log".to_string(); @@ -185,20 +185,18 @@ pub fn init_logging() -> Vec> { println!("Logging path not exists!") } - let log = || { - FileRotate::new( - log_path, - AppendTimestamp::with_format( - "%Y-%m-%d", - FileLimit::MaxFiles(app_config.backup_count), - DateFrom::DateYesterday, - ), - ContentLimit::Time(TimeFrequency::Daily), - Compression::None, - ) - }; + let log_file = FileRotate::new( + &log_path, + AppendTimestamp::with_format( + "%Y-%m-%d", + FileLimit::MaxFiles(app_config.backup_count), + DateFrom::DateYesterday, + ), + ContentLimit::Time(TimeFrequency::Daily), + Compression::None, + ); - app_logger.push(WriteLogger::new(LevelFilter::Debug, file_config, log())); + app_logger.push(WriteLogger::new(LevelFilter::Debug, file_config, log_file)); } else { let term_config = log_config .clone()