Skip to content

Commit e5057f5

Browse files
committed
Have the mock log facade not always print to stdout
In #463 we introduced a mock logger that implements the `log` facade in tests. Previously, it defaulted to always print `TRACE`-level logs to `stdout`. This however can be very spammy (especially since it includes TRACE-level logs of `electrum_client` now). Here, we make printing the log lines optional by `cfg`-gating it.
1 parent 5abb42f commit e5057f5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,5 @@ check-cfg = [
128128
"cfg(tokio_unstable)",
129129
"cfg(cln_test)",
130130
"cfg(lnd_test)",
131+
"cfg(ldk_node_test_log_print)",
131132
]

tests/common/logging.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl LogFacadeLog for MockLogFacadeLogger {
4848
record.line().unwrap(),
4949
record.args()
5050
);
51+
#[cfg(ldk_node_test_log_print)]
5152
println!("{message}");
5253
self.logs.lock().unwrap().push(message);
5354
}

0 commit comments

Comments
 (0)