Default to error logs, override with info only for those programs that need it (#5321)

* Revert "Revert "Default log level to to RUST_LOG=solana=info (#5296)" (#5302)"

This reverts commit 7796e87814.

* Default to error logs, override with info only for those programs that need it
This commit is contained in:
Michael Vines
2019-07-29 10:57:00 -07:00
committed by GitHub
parent 506b305959
commit 4e093525c7
6 changed files with 9 additions and 8 deletions

View File

@ -6,11 +6,14 @@ use std::sync::Once;
static INIT: Once = Once::new();
/// Setup function that is only run once, even if called multiple times.
pub fn setup() {
pub fn setup_with_filter(filter: &str) {
INIT.call_once(|| {
env_logger::Builder::from_default_env()
env_logger::Builder::from_env(env_logger::Env::new().default_filter_or(filter))
.default_format_timestamp_nanos(true)
.init();
});
}
pub fn setup() {
setup_with_filter("error");
}