We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3191a3a commit 910d218Copy full SHA for 910d218
1 file changed
src/main.rs
@@ -1,6 +1,7 @@
1
use clap::Parser;
2
use cli::Command;
3
use server::config::Config;
4
+use std::env;
5
use tracing::{debug, info};
6
7
mod cli;
@@ -17,8 +18,11 @@ async fn main() -> Result<(), error::Error> {
17
18
let args = cli::Cli::parse();
19
let config_path = args.config.clone().unwrap_or_else(Config::default_path);
20
let (config, first_run) = server::config::setup(&config_path)?;
21
+ let force_debug = args.debug
22
+ || env::var("PWMP_DEBUG")
23
+ .is_ok_and(|value| ["OK", "1", "YES", "true"].contains(&value.to_lowercase().as_str()));
24
- if let Err(why) = logging::setup(args.debug, &config) {
25
+ if let Err(why) = logging::setup(force_debug, &config) {
26
eprintln!("Failed to set up logging: {why}");
27
return Err(why);
28
}
0 commit comments