mirror of
https://github.com/rust-lang/log.git
synced 2026-02-15 04:10:13 +00:00
Fix default log level
Turns out we did actually use to log errors by default!
This commit is contained in:
parent
f0d5477a5f
commit
f2aad6bb23
9
env/src/lib.rs
vendored
9
env/src/lib.rs
vendored
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user