Skip to content

Commit 4f9b0fb

Browse files
committed
Avoid writing to stdout during fuzz tests
1 parent 7e94d3a commit 4f9b0fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fuzz/fuzz_targets/utils/test_logger.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ pub struct TestLogger {}
44

55
impl Logger for TestLogger {
66
fn log(&self, record: &Record) {
7-
#[cfg(any(test, not(feature = "fuzztarget")))]
7+
#[cfg(test)]
88
println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args);
9+
#[cfg(not(test))]
10+
let _ = format!("{}", record.args);
911
}
1012
}

0 commit comments

Comments
 (0)