mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-03-24 19:09:22 +00:00
Fix panic hook
This commit is contained in:
parent
156f2b202b
commit
024d5ec78f
|
@ -300,14 +300,8 @@ fn init_logger() -> GameResult {
|
|||
|
||||
fn panic_hook(info: &PanicInfo<'_>) {
|
||||
let backtrace = Backtrace::force_capture();
|
||||
let msg = info.payload().downcast_ref::<&str>().unwrap_or(&"");
|
||||
let location = info.location();
|
||||
|
||||
if location.is_some() {
|
||||
log::error!("Panic occurred in {} with message: '{msg}'\n {backtrace:#}", location.unwrap().to_string());
|
||||
} else {
|
||||
log::error!("Panic occurred with message: '{msg}'\n {backtrace:#}");
|
||||
}
|
||||
log::error!("Panic occurred: {info}\n {backtrace:#}");
|
||||
}
|
||||
|
||||
pub fn init(options: LaunchOptions) -> GameResult {
|
||||
|
|
Loading…
Reference in a new issue