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

#103 in Debugging

Download history 3381/week @ 2023-12-23 5030/week @ 2023-12-30 7449/week @ 2024-01-06 9473/week @ 2024-01-13 5432/week @ 2024-01-20 4340/week @ 2024-01-27 2761/week @ 2024-02-03 2992/week @ 2024-02-10 3230/week @ 2024-02-17 2707/week @ 2024-02-24 3240/week @ 2024-03-02 4414/week @ 2024-03-09 3443/week @ 2024-03-16 3466/week @ 2024-03-23 7444/week @ 2024-03-30 3745/week @ 2024-04-06

18,597 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–14MB
~136K SLoC