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 9465/week @ 2024-11-19 8431/week @ 2024-11-26 9787/week @ 2024-12-03 8806/week @ 2024-12-10 8135/week @ 2024-12-17 7669/week @ 2024-12-24 6495/week @ 2024-12-31 8511/week @ 2025-01-07 8926/week @ 2025-01-14 8062/week @ 2025-01-21 9370/week @ 2025-01-28 11483/week @ 2025-02-04 9232/week @ 2025-02-11 10612/week @ 2025-02-18 13290/week @ 2025-02-25 9325/week @ 2025-03-04

44,301 downloads per month
Used in 127 crates (114 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