pub fn disable() -> Result<(), RedactionBehavior>
Available on crate feature
toggle
only.Expand description
Disables Veil redaction globally.
See the “Environmental Awareness” section in the crate level documentation for more information.
Should only be called once, preferrably at the top of main,
before any calls to Debug
, otherwise Err
will be returned.
Overrides the VEIL_DISABLE_REDACTION
environment variable, if set.
// If the environment variable DISABLE_REDACTION is set veil will not redact anything
if let Ok(env) = std::env::var("APP_ENV") {
if env == "dev" {
veil::disable().unwrap();
}
}