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