Function safelog::flags::enforce_safe_logging

source ·
pub fn enforce_safe_logging() -> Result<Guard>
Expand description

Create a new Guard to prevent anyone else from disabling safe logging.

Until the resulting Guard is dropped, any attempts to call disable_safe_logging will give an error. This guard does not affect calls to with_safe_logging_suppressed.

This call will return an error if safe logging is already disabled.

Note that this function is called “enforce”, not “enable”, since safe logging is enabled by default. Its purpose is to make sure that nothing else has called disable_safe_logging().