You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::env;use env_logger::Builder;fnmain(){Builder::new().parse(&env::var("MY_APP_LOG").unwrap_or_default())// Deprecated method.init();
log::info!("informational message");
log::warn!("warning message");
log::error!("this is an error {}", "message");}
I am not sure for what reason the latest version is shown in the badges, but wouldn't it be better to show the version for which the sample code is intended?
there are instances of code that may have previously worked but are now outdated due to changes in the env_logger crate
https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/config_log.html#use-a-custom-environment-variable-to-set-up-logging
Fix
https://docs.rs/env_logger/latest/env_logger/struct.Builder.html#method.from_env
or
https://docs.rs/env_logger/latest/env_logger/struct.Builder.html#method.parse_env
The text was updated successfully, but these errors were encountered: