#panic #backtrace #stacktrace #color #pretty

better-panic

Pretty panic backtraces inspired by Python’s tracebacks

4 releases

0.2.0 Sep 7, 2019
0.1.2 Jul 15, 2019
0.1.1 Jun 20, 2019
0.1.0 Jun 20, 2019

#158 in Debugging

Download history 684/week @ 2021-06-23 745/week @ 2021-06-30 700/week @ 2021-07-07 825/week @ 2021-07-14 1016/week @ 2021-07-21 849/week @ 2021-07-28 694/week @ 2021-08-04 1307/week @ 2021-08-11 912/week @ 2021-08-18 719/week @ 2021-08-25 784/week @ 2021-09-01 955/week @ 2021-09-08 1004/week @ 2021-09-15 919/week @ 2021-09-22 949/week @ 2021-09-29 851/week @ 2021-10-06

4,782 downloads per month
Used in 31 crates (29 directly)

MIT/Apache

410KB
409 lines

Crates.io

better-panic

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

License: MIT OR Apache-2.0


lib.rs:

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

~4–5.5MB
~123K SLoC