Default to error logging if we can't parse the log filter.

This commit is contained in:
Kris Nuttycombe 2022-04-18 09:28:12 -06:00
parent 244276d244
commit 195bb75502
1 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,9 @@ pub fn main() {
// Log to stderr, configured by the RUST_LOG environment variable.
fmt()
.with_writer(io::stderr)
.with_env_filter(EnvFilter::from_default_env())
.with_env_filter(
EnvFilter::try_from_default_env().unwrap_or_else(|err| EnvFilter::new("error")),
)
.init();
// Allow either Bitcoin-style or GNU-style arguments.