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

#88 in Debugging

Download history 7838/week @ 2024-07-30 6467/week @ 2024-08-06 7717/week @ 2024-08-13 7091/week @ 2024-08-20 8205/week @ 2024-08-27 8260/week @ 2024-09-03 9542/week @ 2024-09-10 9825/week @ 2024-09-17 14266/week @ 2024-09-24 13146/week @ 2024-10-01 13460/week @ 2024-10-08 13953/week @ 2024-10-15 13009/week @ 2024-10-22 11184/week @ 2024-10-29 12452/week @ 2024-11-05 8693/week @ 2024-11-12

47,245 downloads per month
Used in 121 crates (106 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–12MB
~123K SLoC