Merge pull request #2665 from TheBlueMatt/2023-10-scanable-test-logs
authorvalentinewallace <valentinewallace@users.noreply.github.com>
Mon, 16 Oct 2023 19:59:32 +0000 (15:59 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2023 19:59:32 +0000 (15:59 -0400)
Make test log lines somewhat more eye-scannable

lightning/src/util/test_utils.rs

index 8a988b629079647e8cc85c166e3b874986ec1b3e..344ab139116d6c389994214e763ccfda85b12787 100644 (file)
@@ -969,8 +969,10 @@ 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 record.level >= self.level {
-                       #[cfg(all(not(ldk_bench), feature = "std"))]
-                       println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args);
+                       #[cfg(all(not(ldk_bench), feature = "std"))] {
+                               let pfx = format!("{} {} [{}:{}]", self.id, record.level.to_string(), record.module_path, record.line);
+                               println!("{:<55}{}", pfx, record.args);
+                       }
                }
        }
 }