caveman/cave/src/init.rs

15 lines
319 B
Rust
Raw Normal View History

2022-11-05 20:51:18 +01:00
use std::{panic, process};
pub fn exit_on_panic() {
let orig_hook = panic::take_hook();
panic::set_hook(Box::new(move |panic_info| {
// invoke the default handler and exit the process
orig_hook(panic_info);
process::exit(1);
}));
}
pub fn init_logger() {
env_logger::init();
}