Skip to content

Commit

Permalink
reset logger for each input file
Browse files Browse the repository at this point in the history
  • Loading branch information
master-of-zen committed Mar 6, 2022
1 parent 5cb015e commit 8700341
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion av1an-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ pub fn run() -> anyhow::Result<()> {
// because it will, in its Drop implementation, flush all writers to ensure that
// all buffered log lines are flushed before the program terminates,
// and then it calls their shutdown method.
let _logger = Logger::with(log)
let logger = Logger::with(log)
.log_to_file_and_writer(
// UGLY: take first or the files for log path
FileSpec::try_from(PathAbs::new(&args[0].log_file)?)?,
Expand All @@ -738,6 +738,10 @@ pub fn run() -> anyhow::Result<()> {
.start()?;

for mut arg in args {
// Change log file
let new_log_file = FileSpec::try_from(PathAbs::new(&arg.log_file)?)?;
let _ = &logger.reset_flw(&flexi_logger::writers::FileLogWriter::builder(new_log_file))?;

arg.initialize()?;
arg.encode_file()?;
}
Expand Down

0 comments on commit 8700341

Please sign in to comment.