5 unstable releases

0.3.0 Jan 15, 2022
0.2.0 Sep 7, 2019
0.1.2 Jul 15, 2019
0.1.1 Jun 20, 2019
0.1.0 Jun 20, 2019

#49 in Value formatting

Download history 1308/week @ 2023-08-13 1291/week @ 2023-08-20 1265/week @ 2023-08-27 1267/week @ 2023-09-03 3566/week @ 2023-09-10 3176/week @ 2023-09-17 2759/week @ 2023-09-24 1485/week @ 2023-10-01 1445/week @ 2023-10-08 2535/week @ 2023-10-15 2646/week @ 2023-10-22 1560/week @ 2023-10-29 2394/week @ 2023-11-05 2676/week @ 2023-11-12 2980/week @ 2023-11-19 2638/week @ 2023-11-26

10,836 downloads per month
Used in 59 crates (54 directly)

MIT license

410KB
422 lines

better-panic

Build Status Crates.io License rustc 1.42.0 Documentation

better-panic gives you pretty backtraces for panics.

It is inspired by Python tracebacks and tries to replicate them as well as possible. This is what it looks like:

Some of the code is based on the color-backtrace library.

Usage

The most common way to use it is to invoke the install function which installs a panic handler. In debug builds the backtrace is shown automatically, in release builds it's hidden by default.

better_panic::install();

For more configuration see the Settings object.

Features

  • Colorize backtraces to be easier on the eyes
  • Show source snippets if source files are found on disk
  • Hide all the frames after the panic was already initiated

Dependencies

~0.3–13MB
~93K SLoC