Avoid writing to stdout during fuzz tests
[rust-lightning] / fuzz / fuzz_targets / utils / test_logger.rs
1 use lightning::util::logger::{Logger, Record};
2
3 pub struct TestLogger {}
4
5 impl Logger for TestLogger {
6         fn log(&self, record: &Record) {
7                 #[cfg(test)]
8                 println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args);
9                 #[cfg(not(test))]
10                 let _ = format!("{}", record.args);
11         }
12 }