From: Matt Corallo Date: Mon, 3 Dec 2018 18:58:11 +0000 (-0500) Subject: Avoid writing to stdout during fuzz tests X-Git-Tag: v0.0.12~261^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2018-12-fuzz-fix-no-witness;p=rust-lightning Avoid writing to stdout during fuzz tests --- diff --git a/fuzz/fuzz_targets/utils/test_logger.rs b/fuzz/fuzz_targets/utils/test_logger.rs index 2ef1196b5..f828d0638 100644 --- a/fuzz/fuzz_targets/utils/test_logger.rs +++ b/fuzz/fuzz_targets/utils/test_logger.rs @@ -4,7 +4,9 @@ pub struct TestLogger {} impl Logger for TestLogger { fn log(&self, record: &Record) { - #[cfg(any(test, not(feature = "fuzztarget")))] + #[cfg(test)] println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args); + #[cfg(not(test))] + let _ = format!("{}", record.args); } }