improved the logging

This commit is contained in:
2023-03-13 00:21:56 +01:00
parent 96c6c8d94d
commit dc02b86adf
4 changed files with 50 additions and 19 deletions

20
src/app/log/mod.rs Normal file
View File

@@ -0,0 +1,20 @@
use colored::Colorize;
pub fn display_status(context1: &str, context2: &str, in_path: &str, out_path: &str) {
let colored_context = color_context(context2);
println!(
"({}) [{}] {} -> {}",
context1.bold(),
colored_context,
in_path,
out_path
);
}
fn color_context(context: &str) -> colored::ColoredString {
if context == "Error" {
return context.bright_red()
} else {
return context.bright_green()
}
}