fix: conditional
This commit is contained in:
parent
edbe8a5e3f
commit
ff9413be2a
1 changed files with 9 additions and 1 deletions
|
|
@ -39,7 +39,14 @@ pub async fn log(level: LogLevel, path: &str, detail: String) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let debug_mode = cfg!(debug_assertions);
|
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);
|
println!("{}", ansi_string);
|
||||||
|
|
||||||
if let Err(e) = logfile.write(logfile_string.as_bytes()) {
|
if let Err(e) = logfile.write(logfile_string.as_bytes()) {
|
||||||
|
|
@ -48,3 +55,4 @@ pub async fn log(level: LogLevel, path: &str, detail: String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue