Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitsuhiko/better-panic
A python inspired panic handler for rust
https://github.com/mitsuhiko/better-panic
Last synced: 6 days ago
JSON representation
A python inspired panic handler for rust
- Host: GitHub
- URL: https://github.com/mitsuhiko/better-panic
- Owner: mitsuhiko
- License: mit
- Created: 2019-06-20T17:10:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-05T17:12:13.000Z (over 1 year ago)
- Last Synced: 2024-12-20T23:05:20.599Z (13 days ago)
- Language: Rust
- Size: 398 KB
- Stars: 429
- Watchers: 8
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# better-panic
[![Build Status](https://github.com/mitsuhiko/better-panic/workflows/Tests/badge.svg?branch=master)](https://github.com/mitsuhiko/better-panic/actions?query=workflow%3ATests)
[![Crates.io](https://img.shields.io/crates/d/better-panic.svg)](https://crates.io/crates/better-panic)
[![License](https://img.shields.io/github/license/mitsuhiko/better-panic)](https://github.com/mitsuhiko/better-panic/blob/master/LICENSE)
[![rustc 1.42.0](https://img.shields.io/badge/rust-1.42%2B-orange.svg)](https://img.shields.io/badge/rust-1.42%2B-orange.svg)
[![Documentation](https://docs.rs/better-panic/badge.svg)](https://docs.rs/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](https://crates.io/crates/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.```rust
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 and Links
- [Documentation](https://docs.rs/better-panic/)
- [Issue Tracker](https://github.com/mitsuhiko/better-panic/issues)
- [Examples](https://github.com/mitsuhiko/better-panic/tree/master/examples)
- License: [MIT](https://github.com/mitsuhiko/better-panic/blob/master/LICENSE)