lazy-panic 0.3.1

Lazy utils to customize panic messages
Documentation

lazy-panic.rs

Build Status Crates.io Documentation

Provides lazy utilities to lazily set custom panic hook

Available features

  • backtrace-on - Enables Debug formatter to print backtrace

Example

Setup 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`
    painic!("LOLKA");

    set_panic_message!(lazy_panic::formatter::Debug);
    //prints `{Backtrace}\nPanic: main.rs:12 - LOLKA\n`
    painic!("LOLKA");
}