X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Ffuzz_targets%2Futils%2Ftest_logger.rs;h=097d001dbb25f80e0049a6c1526c379365a0f49f;hb=e91b6469f35c1f0c4a7f2fc48291e70e892a9b26;hp=f828d0638f17726690c2c9b83807866c634287bd;hpb=4f9b0fbd3f3b252ceb8e9aeb19c2d0635294dc1e;p=rust-lightning diff --git a/fuzz/fuzz_targets/utils/test_logger.rs b/fuzz/fuzz_targets/utils/test_logger.rs index f828d0638..097d001db 100644 --- a/fuzz/fuzz_targets/utils/test_logger.rs +++ b/fuzz/fuzz_targets/utils/test_logger.rs @@ -1,11 +1,22 @@ use lightning::util::logger::{Logger, Record}; +pub struct TestLogger { + #[cfg(test)] + id: String, +} -pub struct TestLogger {} +impl TestLogger { + pub fn new(_id: String) -> TestLogger { + TestLogger { + #[cfg(test)] + id: _id + } + } +} 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); + println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args); #[cfg(not(test))] let _ = format!("{}", record.args); }