summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarlan Lieberman-Berg <hlieberman@setec.io>2018-03-22 21:06:12 -0400
committerJoe Wilm <jwilm@users.noreply.github.com>2018-03-22 18:10:27 -0700
commit0edac74e61a780afeb5c2f55cfe20d2267bdda2a (patch)
treea1807e2ad6906a602c8e6f71562f08c6726069b8
parent6debc4f3351446417d0c4e38173cd9ef0faa71d5 (diff)
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.
-rw-r--r--src/logging.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/logging.rs b/src/logging.rs
index 421223e8..5691eb78 100644
--- a/src/logging.rs
+++ b/src/logging.rs
@@ -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))