From: Matt Corallo Date: Wed, 30 Jun 2021 02:19:28 +0000 (+0000) Subject: Correct test log printing due to inverted comparison X-Git-Tag: v0.0.99~8^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2021-06-actionable-errors;p=rust-lightning 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. --- diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index b4d274f6..adaf631f 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -439,7 +439,7 @@ impl TestLogger { impl Logger for TestLogger { fn log(&self, record: &Record) { *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); } }