Explicitly call log::set_max_level (Closes: #1201)

For some reason, log 0.4 requires that we explicitly set the log level
with log::set_max_level or it defaults to Off.  The documentation
isn't clear but suggests we must do this in addition to doing the
filtration ourselves in the Log impl.
This commit is contained in:
Harlan Lieberman-Berg 2018-03-22 21:06:12 -04:00 committed by Joe Wilm
parent 6debc4f335
commit 0edac74e61
1 changed files with 1 additions and 0 deletions

View File

@ -31,6 +31,7 @@ impl<T: Send + io::Write> Logger<T> {
// False positive, see: https://github.com/rust-lang-nursery/rust-clippy/issues/734
#[cfg_attr(feature = "clippy", allow(new_ret_no_self))]
pub fn new(output: T, level: log::LevelFilter) -> Logger<io::LineWriter<T>> {
log::set_max_level(level);
Logger {
level,
output: sync::Mutex::new(io::LineWriter::new(output))