Skip to content

Commit

Permalink
chore: add output path(s) to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhall88 committed Sep 20, 2024
1 parent 754f0db commit 1dae636
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,21 @@ fn main() -> Result<()> {
if outputs.len() == 2 && threads > 1 {
let mut handles = Vec::new();
for (input, output) in outputs {
let handle =
std::thread::spawn(move || output_compression.compress(&input, &output, threads));
let handle = std::thread::spawn(move || {
info!("Writing output file to: {:?}", &output);
output_compression.compress(&input, &output, threads)
});
handles.push(handle);
}
for handle in handles {
handle
.join()
.map_err(|e| anyhow::anyhow!("Thread panicked: {:?}", e))??;
.map_err(|e| anyhow::anyhow!("Thread panicked when writing output: {:?}", e))??;
}
} else {
for (input, output) in outputs {
output_compression.compress(&input, &output, threads)?;
info!("Output file written to: {:?}", &output);
}
}

Expand Down

0 comments on commit 1dae636

Please sign in to comment.