7 releases (4 breaking)
0.5.0 | Feb 10, 2025 |
---|---|
0.4.0 | Feb 10, 2025 |
0.3.0 | Sep 3, 2024 |
0.2.3 | Aug 31, 2024 |
0.1.0 | May 16, 2024 |
#318 in Debugging
322 downloads per month
27KB
397 lines
Client library for Don't Panic Server. This crate registers a panic handler and send each panic from your application to a backend server. If configured, the latest log messages before each panic are sent as well. Supported logging facilities are log and tracing.
Example Usage
To use dontpanic
, add this to your Cargo.toml
:
[dependencies]
dontpanic = "*"
use anyhow::Result;
fn main() -> Result<()> {
let client = dontpanic::builder("<PROJECT_API_KEY>")
.environment("production")
.version(env!("CARGO_PKG_VERSION"))
.build()?
let logger = env_logger::Builder::from_default_env().build();
client.set_logger(logger)?;
log::info!("What's happening here?");
log::error!("Booooom");
Option::<u32>::None.unwrap();
Ok(())
}
<PROJECT_API_KEY>
can be obtained from Don't Panic Server. For more examples see the Documentation.
Contributing
All commit messages must follow Conventional Commits specification.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Dependencies
~5.5–7MB
~134K SLoC