lazy-panic

Crates.iolazy-panic
lib.rslazy-panic
version1.0.0
sourcesrc
created_at2016-09-30 16:46:34.252865
updated_at2018-11-09 04:35:48.12146
descriptionLazy utils to customize panic messages
homepage
repositoryhttps://github.com/DoumanAsh/lazy-panic.rs
max_upload_size
id6665
size13,028
Douman (DoumanAsh)

documentation

https://docs.rs/crate/lazy-panic

README

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");
}
Commit count: 12

cargo fmt