[][src]Crate 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.

pretty_backtrace::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

Structs

Settings

Configuration for panic printing.

Enums

Verbosity

Defines how verbose the backtrace is supposed to be.

Functions

debug_install

Installs the panic handler with debug settings.

install

Installs the panic handler with Settings::auto.