Skip to content

Commit

Permalink
style: fix log_level
Browse files Browse the repository at this point in the history
  • Loading branch information
Marsyew authored Oct 13, 2023
1 parent 63317d9 commit 4f721a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ mod path;

#[tokio::main]
async fn main() {
let log_level = env::var("LOG_LEVEL").unwrap_or("info".to_string());
let log_level = if cfg!(debug_assertions) {
env::var("LOG_LEVEL").unwrap_or_else(|_| "debug".to_string())
} else {
env::var("LOG_LEVEL").unwrap_or_else(|_| "info".to_string())
};
let level_filter = match log_level.as_str() {
"off" => log::LevelFilter::Off,
"error" => log::LevelFilter::Error,
Expand Down

0 comments on commit 4f721a3

Please sign in to comment.