From 4b0a3f5b1a97e0b3d2297af606848e00255c9cc0 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Thu, 12 May 2022 17:56:11 +0200 Subject: [PATCH 1/2] update --- Cargo.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 362ba5e2..6dffe156 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,9 +94,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.17" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47582c09be7c8b32c0ab3a6181825ababb713fde6fff20fc573a3870dd45c6a0" +checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" dependencies = [ "atty", "bitflags", @@ -111,9 +111,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.7" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" +checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" dependencies = [ "heck", "proc-macro-error", @@ -1262,12 +1262,12 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca642ba17f8b2995138b1d7711829c92e98c0a25ea019de790f4f09279c4e296" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", - "windows-sys", + "winapi 0.3.9", ] [[package]] @@ -1278,9 +1278,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "04066589568b72ec65f42d65a1a52436e954b168773148893c020269563decf2" dependencies = [ "proc-macro2", "quote", From 52f7d97ca69edeb186a35a97d19d782d3eee817f Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Thu, 12 May 2022 17:57:15 +0200 Subject: [PATCH 2/2] fix date string, simple FileRotate object --- src/utils/controller.rs | 2 +- src/utils/logging.rs | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) 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()