Add location to log function

This commit is contained in:
Juno Takano 2026-04-23 16:06:11 -03:00
commit 0fbc65e24b

View file

@ -1,7 +1,9 @@
#[track_caller]
pub fn elog(message: &str) { pub fn elog(message: &str) {
if let Ok(debug) = std::env::var("DEBUG") if let Ok(debug) = std::env::var("DEBUG")
&& !debug.is_empty() && !debug.is_empty()
{ {
eprintln!(" [log] {message}"); let location = std::panic::Location::caller();
eprintln!(" !debug [{location}] {message}");
} }
} }