pub fn with_safe_logging_suppressed<F, V>(func: F) -> Vwhere
F: FnOnce() -> V,
Expand description
Run a given function with the regular safelog
functionality suppressed.
The provided function, and everything it calls, will display
Sensitive
values as if they were not sensitive.
§Examples
use safelog::{Sensitive, with_safe_logging_suppressed};
let string = Sensitive::new("swordfish");
// Ordinarily, the string isn't displayed as normal
assert_eq!(format!("The value is {}", string),
"The value is [scrubbed]");
// But you can override that:
assert_eq!(
with_safe_logging_suppressed(|| format!("The value is {}", string)),
"The value is swordfish"
);