lazy-panic.rs
Provides lazy utilities to lazily set custom panic hook
Available features
backtrace-on
- EnablesDebug
formatter to print backtrace
Example
Setup simple panic message
extern crate lazy_panic;
Provides lazy utilities to lazily set custom panic hook
backtrace-on
- Enables Debug
formatter to print backtraceSetup simple panic message
#[macro_import]
extern crate lazy_panic;
fn main() {
set_panic_message!(lazy_panic::formatter::Simple);
//prints `Panic: main.rs:8 - LOLKA\n`
panic!("LOLKA");
set_panic_message!(lazy_panic::formatter::Debug);
//prints `{Backtrace}\nPanic: main.rs:12 - LOLKA\n`
panic!("LOLKA");
}