]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Avoid writing to stdout during fuzz tests 2018-12-fuzz-fix-no-witness
authorMatt Corallo <git@bluematt.me>
Mon, 3 Dec 2018 18:58:11 +0000 (13:58 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 3 Dec 2018 18:58:50 +0000 (13:58 -0500)
fuzz/fuzz_targets/utils/test_logger.rs

index 2ef1196b586af79c82cde6b787098302997de38e..f828d0638f17726690c2c9b83807866c634287bd 100644 (file)
@@ -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);
        }
 }