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

#92 in Debugging

Download history 8661/week @ 2024-08-31 8933/week @ 2024-09-07 9407/week @ 2024-09-14 12485/week @ 2024-09-21 13420/week @ 2024-09-28 13971/week @ 2024-10-05 13871/week @ 2024-10-12 13314/week @ 2024-10-19 11116/week @ 2024-10-26 11965/week @ 2024-11-02 11509/week @ 2024-11-09 10172/week @ 2024-11-16 7512/week @ 2024-11-23 10356/week @ 2024-11-30 8594/week @ 2024-12-07 6772/week @ 2024-12-14

34,620 downloads per month
Used in 124 crates (109 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

~2–11MB
~118K SLoC