We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a413555 commit e3f6619Copy full SHA for e3f6619
src/main.rs
@@ -18,9 +18,14 @@ async fn main() -> io::Result<()> {
18
}
19
};
20
21
- env_logger::init_from_env(
22
- env_logger::Env::default().default_filter_or(if !config.debug { "info" } else { "debug" }),
23
- );
+ env_logger::init_from_env(env_logger::Env::default().default_filter_or(
+ // Set log level to "debug" if enabled in config or environment; default is "info"
+ if !config.debug && env::var("DEBUG").map(|v| v != "true").unwrap_or(true) {
24
+ "info"
25
+ } else {
26
+ "debug"
27
+ },
28
+ ));
29
30
let listener = TcpListener::bind(format!("{}:{}", config.host, config.port)).await?;
31
info!("Server listening on port {}", config.port);
0 commit comments