Skip to content

Commit

Permalink
fixing global logging again
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjurenka authored and ForAllSecure Mayhem Bot committed Jan 2, 2025
1 parent 7cdebe5 commit 111bee3
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions fuzz/fuzz_targets/global_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@ impl LogVerify {
}
fn log(&mut self, record: &log::Record) {
let formatted_message = format!("{}", record.args());
match &*formatted_message {
"[INFO] Test information message" => {
assert_eq!(self.info, false, "expected only one info message");
self.info = true;
}
"[WARN] Test warning message" => {
assert_eq!(self.warn, false, "expected only one warn message");
self.warn = true;
}
"[ERROR] Test error message" => {
assert_eq!(self.error, false, "expected only one error message");
self.error = true;
}
_ => {},
if formatted_message.starts_with("[INFO] ") {
assert_eq!(self.info, false, "expected only one info message");
self.info = true;
} else if formatted_message.starts_with("[WARN] ") {
assert_eq!(self.warn, false, "expected only one warn message");
self.warn = true;
} else if formatted_message.starts_with("[ERROR] ") {
assert_eq!(self.error, false, "expected only one error message");
self.error = true;
} else {
panic!();
}
}
}
Expand Down

0 comments on commit 111bee3

Please sign in to comment.