fix: conditional

This commit is contained in:
Xory 2025-12-18 17:00:34 +02:00
parent edbe8a5e3f
commit ff9413be2a

View file

@ -39,7 +39,14 @@ pub async fn log(level: LogLevel, path: &str, detail: String) {
};
let debug_mode = cfg!(debug_assertions);
if (level == LogLevel::Debug) && !debug_mode {
if !(level == LogLevel::Debug) {
println!("{}", ansi_string);
if let Err(e) = logfile.write(logfile_string.as_bytes()) {
eprintln!("Got error {:?} while trying to write to logfile.", e);
}
} else {
if debug_mode {
println!("{}", ansi_string);
if let Err(e) = logfile.write(logfile_string.as_bytes()) {
@ -47,4 +54,5 @@ pub async fn log(level: LogLevel, path: &str, detail: String) {
}
}
}
}
}