Crates.io | crashreport |
lib.rs | crashreport |
version | 1.0.1 |
source | src |
created_at | 2022-04-14 15:35:16.803473 |
updated_at | 2022-04-14 16:10:42.260589 |
description | Automatic GitHub crash reporting system for any Rust crate |
homepage | https://github.com/ewpratten/crashreport-rs |
repository | https://github.com/ewpratten/crashreport-rs |
max_upload_size | |
id | 567591 |
size | 90,321 |
crashreport
is a set & forget crate that appends a button to your application's panic messages allowing users to quickly report basic diagnostic information back to you.
Firstly, this crate relies on you setting the repository
key in your Cargo.toml
file. When using crashreport
, your Cargo.toml
could end up looking something like this:
[package]
name = "my-awesome-crate"
version = "0.1.0"
repository = "https://github.com/ewpratten/my-awesome-crate"
[dependencies]
crashreport = "^1.0.0"
# If you never want terminal colors, import the crate like this instead:
crashreport = { version = "^1.0.0", default-features = false }
On the code side, simply use our crashreport!
macro to add a button to your panic messages globally:
#[macro_use]
extern crate crashreport;
pub fn main() {
// The important bit :)
crashreport!();
// ... do stuff
// Your panics are now a little fancier!
panic!("This is a panic!");
}
crashreport
works by appending a new function to the end of whatever your existing panic handler is. Don't worry, you can keep your fancy custom handlers if you want. Just initialize them before calling crashreport!
.
As of now, we support the following hosted Git services:
If you happen to be using a self-hosted version of any of these services, crashreport
will not pick it up automatically. Instead, enable one of the following features to force override provider resolution:
assume_github
assume_gitlab
Enabling more than one of these features will result in the first being used
Whenever possible, crashreport
will try to make clickable buttons in your terminal. The work of deciding weather the terminal supports this is carried out by the supports-hyperlinks
crate. If issues arise, please open an issue over there to add support.
Worst case, you can force-disable button creation (falling back on printing out a URL) by setting FORCE_HYPERLINK=0
in your environment.