feat(wm): report full errors in debug mode

This gives us a stack trace style error report in the log when in debug
mode, which makes it much quicker to track down the origin of an error.
This commit is contained in:
James Tucker
2024-04-13 17:09:14 -07:00
committed by LGUG2Z
parent 28b46c54da
commit 15c3b32608

View File

@@ -44,7 +44,13 @@ pub fn listen_for_events(wm: Arc<Mutex<WindowManager>>) {
if let Ok(event) = receiver.recv() {
match wm.lock().process_event(event) {
Ok(()) => {}
Err(error) => tracing::error!("{}", error),
Err(error) => {
if cfg!(debug_assertions) {
tracing::error!("{:?}", error)
} else {
tracing::error!("{}", error)
}
}
}
}
}