update dependencies, added mysql error

main
Mathias Rothenhaeusler 2024-12-04 18:18:41 +01:00
parent 5a5b5fb4a3
commit 5642ab4717
3 changed files with 780 additions and 744 deletions

1511
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ pub fn process_args(args: Cli, db: Db) {
if config {
filter_service.get_filter_configs(&filter_id)
} else if log {
filter_service.get_filter_log(&filter_id)
filter_service.get_filter_log(&filter_id, all)
} else {
filter_service.get_filter(&filter_id, all)
}

View File

@ -73,7 +73,7 @@ impl FilterService {
};
}
pub fn get_filter_log(&mut self, filter_id: &usize) {
pub fn get_filter_log(&mut self, filter_id: &usize, all: bool) {
let result = self.repo.find_filter_log(filter_id);
match result {
Ok(filter_log) => {
@ -89,12 +89,21 @@ impl FilterService {
match filter_log.error_code.as_str() {
"WARNING" => {
println!("{}", filter_log.error_msg.yellow());
if all {
println!("{}", filter_log.mysql_error.yellow());
}
}
"ERROR" => {
println!("{}", filter_log.error_msg.red());
if all {
println!("{}", filter_log.mysql_error.red());
}
}
"DEBUG" => {
println!("{}", filter_log.error_msg.green());
if all {
println!("{}", filter_log.error_msg.green())
}
}
_ => {
println!("{}", filter_log.error_msg);