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
797 stars 124 forks source link

Format builder's state as RUST_LOG-like value #257

Open nyurik opened 1 year ago

nyurik commented 1 year ago

For logging purposes, I would like to print the RUST_LOG and possibly RUST_LOG_STYLE values as ingested by the env_logger. Is there a way to serialize internal state of the env_logger::Builder as a RUST_LOG-like string?

I could of course just read the RUST_LOG env var, and do a default fallback, but it seems this won't be as clean as having the builder format its own state?