From f2aad6bb23636dca801d366eca227ddcafd268a7 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 17 May 2015 23:04:49 -0700 Subject: [PATCH] Fix default log level Turns out we did actually use to log errors by default! --- env/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/env/src/lib.rs b/env/src/lib.rs index c0cd223..d712625 100644 --- a/env/src/lib.rs +++ b/env/src/lib.rs @@ -73,9 +73,10 @@ //! ## Enabling logging //! //! Log levels are controlled on a per-module basis, and by default all logging -//! is disabled. Logging is controlled via the `RUST_LOG` environment variable. -//! The value of this environment variable is a comma-separated list of logging -//! directives. A logging directive is of the form: +//! is disabled except for `error!`. Logging is controlled via the `RUST_LOG` +//! environment variable. The value of this environment variable is a +//! comma-separated list of logging directives. A logging directive is of the +//! form: //! //! ```text //! path::to::module=log_level @@ -196,7 +197,7 @@ pub fn init() -> Result<(), SetLoggerError> { log::set_logger(|max_level| { let (mut directives, filter) = match env::var("RUST_LOG") { Ok(spec) => parse_logging_spec(&spec), - Err(..) => (Vec::new(), None), + Err(..) => (vec![LogDirective { name: None, level: LogLevelFilter::Error }], None), }; // Sort the provided directives by length of their name, this allows a