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

#65 in Debugging

Download history 8579/week @ 2024-12-08 8605/week @ 2024-12-15 7881/week @ 2024-12-22 6484/week @ 2024-12-29 8453/week @ 2025-01-05 8012/week @ 2025-01-12 9174/week @ 2025-01-19 8529/week @ 2025-01-26 11258/week @ 2025-02-02 9694/week @ 2025-02-09 9711/week @ 2025-02-16 13542/week @ 2025-02-23 11486/week @ 2025-03-02 10350/week @ 2025-03-09 10900/week @ 2025-03-16 8391/week @ 2025-03-23

42,354 downloads per month
Used in 128 crates (115 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
~117K SLoC