color-backtrace 0.2.1

Colorful panic backtraces

color-backtrace

Crates.io docs.rs MIT licensed

A Rust library that makes panics a little less painful by nicely colorizing them and printing the relevant source snippets.

[dependencies]
color-backtrace = { version = "0.2" }

To enable it, simply place this code somewhere in your app initialization code:

color_backtrace::install();

If you want to customize some settings, you can instead do:

use color_backtrace::{install_with_settings, Settings};
install_with_settings(Settings::new().message("Custom message!"));

Features

  • Colorize backtraces to be easier on the eyes
  • Show source snippets if source files are found on disk
  • Print frames of application code vs dependencies in different color
  • Hide all the frames after the panic was already initiated
  • Hide language runtime initialization frames

Screenshot

Screenshot