-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Default log level #36
Comments
Here is how we do it as a workaround: if let Err(_) = std::env::var("SMARTSHAPE_CLI_LOG") {
std::env::set_var("SMARTSHAPE_CLI_LOG", "warn");
} |
@promethe42 nice workaround! The only caveat is that if set (also clippy recommends |
I think the
|
Hmmmmmmmmmmmm that's true, didn't realize that |
I don't need the env vars to work (I have a CLI with a repeatable verbose flag) so I'm doing something like: use log::LevelFilter;
pretty_env_logger::formatted_builder().filter_level(LevelFilter::Warn).init(); |
This should be upstreamed to https://github.com/rust-cli/env_logger In deltachat/deltachat-core-rust#5112 I did: pretty_env_logger::formatted_timed_builder()
.parse_default_env()
.filter_module("deltachat_repl", log::LevelFilter::Info)
.init(); This parses Upstream issue is at rust-cli/env_logger#162 |
Wouldn't this be fixed by swapping the
that way the env variable should be able to overwrite the default. |
In env_logger it's possible to provide a default log level by using:
Would you consider adding this feature (or maybe accepting a PR)?
The text was updated successfully, but these errors were encountered: