Skip to main content

install

Function install 

Source
pub fn install(
    paths: &AppPaths,
    role: LogRole,
    default_filter: &str,
) -> Result<LoggingGuard, LoggingError>
Expand description

Installs the redacting sink as this process’s global subscriber, writing daily-rotating files into logs/.

role decides the file, for the reason LogRole gives. default_filter applies when RUST_LOG is unset or unparseable.

§Errors

LoggingError::Directory, LoggingError::Appender and LoggingError::AlreadyInstalled. None of them is fatal to the caller, and the CLI treats all three as a warning: a host show that refused to print a capacity because a log file could not be opened would be a worse failure than the one it was reporting.