Skip to content

Commit 5fdc770

Browse files
Merge pull request #2665 from TheBlueMatt/2023-10-scanable-test-logs
Make test log lines somewhat more eye-scannable
2 parents b1d3aa8 + ab21177 commit 5fdc770

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/util/test_utils.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,10 @@ impl Logger for TestLogger {
969969
fn log(&self, record: &Record) {
970970
*self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1;
971971
if record.level >= self.level {
972-
#[cfg(all(not(ldk_bench), feature = "std"))]
973-
println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args);
972+
#[cfg(all(not(ldk_bench), feature = "std"))] {
973+
let pfx = format!("{} {} [{}:{}]", self.id, record.level.to_string(), record.module_path, record.line);
974+
println!("{:<55}{}", pfx, record.args);
975+
}
974976
}
975977
}
976978
}

0 commit comments

Comments
 (0)