Skip to content

Commit

Permalink
Explicitly call log::set_max_level (Closes: alacritty#1201)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hlieberman authored and jwilm committed Mar 23, 2018
1 parent 6debc4f commit 0edac74
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 0edac74

Please sign in to comment.