rust-lightning/fuzz/fuzz_targets/utils/test_logger.rs

13 lines
338 B
Rust
Raw Normal View History

2018-08-16 21:25:56 -04:00
use lightning::util::logger::{Logger, Record};
2018-08-16 21:25:56 -04:00
pub struct TestLogger {}
impl Logger for TestLogger {
fn log(&self, record: &Record) {
#[cfg(test)]
println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args);
#[cfg(not(test))]
let _ = format!("{}", record.args);
}
}