7 releases (1 stable)

Uses old Rust 2015

1.0.0 Nov 9, 2018
0.3.2 May 29, 2018
0.2.0 May 28, 2018
0.1.1 Sep 30, 2016

#6 in #lazily


Used in x11-input-supercharger

MIT license

12KB
229 lines

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

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

lib.rs:

Provides lazy utilities to lazily set custom panic hook.

Dependencies

~0–520KB
~10K SLoC