Commit
+10 -3 +/-1 browse
1 | diff --git a/src/main.rs b/src/main.rs |
2 | index d8061ad..61da688 100644 |
3 | --- a/src/main.rs |
4 | +++ b/src/main.rs |
5 | @@ -82,9 +82,16 @@ struct Args { |
6 | impl Args { |
7 | fn main(self) -> Result<(), Box<dyn std::error::Error>> { |
8 | // Initialize logging. |
9 | - pretty_env_logger::formatted_timed_builder() |
10 | - .filter_module("rudolfs", self.log_level) |
11 | - .init(); |
12 | + let mut logger_builder = pretty_env_logger::formatted_timed_builder(); |
13 | + logger_builder.filter_module("rudolfs", self.log_level); |
14 | + |
15 | + if let Ok(env) = std::env::var("RUST_LOG") { |
16 | + // Support the addition of RUST_LOG to help with debugging |
17 | + // dependencies, such as Hyper. |
18 | + logger_builder.parse_filters(&env); |
19 | + } |
20 | + |
21 | + logger_builder.init(); |
22 | |
23 | // Find a socket address to bind to. This will resolve domain names. |
24 | let addr = self |