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 4242/week @ 2023-12-13 2710/week @ 2023-12-20 3552/week @ 2023-12-27 6787/week @ 2024-01-03 9828/week @ 2024-01-10 6705/week @ 2024-01-17 5276/week @ 2024-01-24 2872/week @ 2024-01-31 2822/week @ 2024-02-07 3291/week @ 2024-02-14 2905/week @ 2024-02-21 3209/week @ 2024-02-28 4137/week @ 2024-03-06 3348/week @ 2024-03-13 3683/week @ 2024-03-20 2838/week @ 2024-03-27

14,520 downloads per month
Used in 77 crates (73 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

~3–13MB
~136K SLoC