Correct test log printing due to inverted comparison 2021-06-actionable-errors
authorMatt Corallo <git@bluematt.me>
Wed, 30 Jun 2021 02:19:28 +0000 (02:19 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 30 Jun 2021 16:12:21 +0000 (16:12 +0000)
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.

lightning/src/util/test_utils.rs

index b4d274f683cb5b414b9a174e781feb978600e815..adaf631f8a93b4f63d68ae71bde3441e47635b92 100644 (file)
@@ -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);
                }
        }