#lazy #panic #lazy-evaluation

lazy-panic

Lazy utils to customize panic messages

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

#160 in Value formatting

Download history 16/week @ 2023-08-16 12/week @ 2023-08-23 6/week @ 2023-08-30 27/week @ 2023-09-06 16/week @ 2023-09-13 11/week @ 2023-09-20 13/week @ 2023-09-27 8/week @ 2023-10-04 15/week @ 2023-10-11 16/week @ 2023-10-18 37/week @ 2023-10-25 20/week @ 2023-11-01 11/week @ 2023-11-08 9/week @ 2023-11-15 17/week @ 2023-11-22 39/week @ 2023-11-29

77 downloads per month
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–510KB
~10K SLoC