Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/doumanash/lazy-panic.rs

Provides lazy utilities to lazily set custom panic hook
https://github.com/doumanash/lazy-panic.rs

Last synced: 1 day ago
JSON representation

Provides lazy utilities to lazily set custom panic hook

Awesome Lists containing this project

README

        

lazy-panic.rs
====================

[![Build Status](https://travis-ci.org/DoumanAsh/lazy-panic.rs.svg?branch=master)](https://travis-ci.org/DoumanAsh/lazy-panic.rs)
[![Crates.io](https://img.shields.io/crates/v/lazy-panic.svg)](https://crates.io/crates/lazy-panic)
[![Documentation](https://docs.rs/lazy-panic/badge.svg)](https://docs.rs/crate/lazy-panic)

Provides lazy utilities to lazily set custom panic hook

## Available features

- `backtrace-on` - Enables `Debug` formatter to print backtrace

## Example

Setup simple panic message

```rust
#[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");
}