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

#77 in Debugging

Download history 6624/week @ 2024-06-03 4067/week @ 2024-06-10 4812/week @ 2024-06-17 5470/week @ 2024-06-24 5896/week @ 2024-07-01 7841/week @ 2024-07-08 7615/week @ 2024-07-15 7020/week @ 2024-07-22 7382/week @ 2024-07-29 6913/week @ 2024-08-05 7351/week @ 2024-08-12 7071/week @ 2024-08-19 8494/week @ 2024-08-26 8103/week @ 2024-09-02 9284/week @ 2024-09-09 9083/week @ 2024-09-16

35,617 downloads per month
Used in 107 crates (98 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
~125K SLoC