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

#119 in Debugging

Download history 2698/week @ 2023-11-23 4537/week @ 2023-11-30 4479/week @ 2023-12-07 3840/week @ 2023-12-14 3356/week @ 2023-12-21 3637/week @ 2023-12-28 6722/week @ 2024-01-04 10188/week @ 2024-01-11 6497/week @ 2024-01-18 4556/week @ 2024-01-25 2867/week @ 2024-02-01 2916/week @ 2024-02-08 3279/week @ 2024-02-15 2876/week @ 2024-02-22 3105/week @ 2024-02-29 3283/week @ 2024-03-07

13,047 downloads per month
Used in 75 crates (71 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–13MB
~136K SLoC