rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
803 stars 125 forks source link

Builder get current log level #331

Open xeruf opened 1 month ago

xeruf commented 1 month ago

I would like to set the log level of a specific module depending on the global loglevel, specifically -1 - i.e. if the global loglevel (as set by the environment variable RUST_LOG) is Debug, the level should be Info. If no level is set via environment variable, it should default to only Errors.

I think this could be added to the builder to request already set directives, so that I don't have to go about parsing the environment variables again.

epage commented 1 month ago

Could you provide example code the API you have in mind for this?