Skip to content

SimpleLogger::env doesn't (fully) simulate env_logger #75

@d4h0

Description

@d4h0

The docs of SimpleLogger::env say "Simulates env_logger behavior", but this doesn't seem to be true.

The docs of env_logger mention "Logging is controlled via the RUST_LOG environment variable. The value of this environment variable is a comma-separated list of logging directives.", but comma-seperated logging directives are not supported in simple_logger:

    pub fn env(mut self) -> SimpleLogger {
        self.default_level = std::env::var("RUST_LOG")
            .ok()
            .as_deref()
            .map(log::LevelFilter::from_str)
            .and_then(Result::ok)
            .unwrap_or(self.default_level);

        self
    }

PS: Thanks for creating simple_logger. I like it quite a lot, and use it for all projects for which the tracing crate would be over-kill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions