Correct test log printing due to inverted comparison

We changed the sort order of log levels to be more natural, but this
comparison wasn't updated accordingly. Likely the reason it was
left strange for so long is it also had the comparison argument
ordering flipped.
This commit is contained in:
Matt Corallo 2021-06-30 02:19:28 +00:00
parent e7560c83b4
commit e8110ab33f

View file

@ -439,7 +439,7 @@ impl TestLogger {
impl Logger for TestLogger { impl Logger for TestLogger {
fn log(&self, record: &Record) { fn log(&self, record: &Record) {
*self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1; *self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1;
if self.level >= record.level { if record.level >= self.level {
println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args); println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args);
} }
} }