dontpanic

Crates.iodontpanic
lib.rsdontpanic
version0.3.0
sourcesrc
created_at2024-05-16 08:40:42.508447
updated_at2024-09-03 13:00:27.881096
descriptionGet instant notifications about any panic!(); in your codebase.
homepage
repositoryhttps://github.com/peterprototypes/dontpanic
max_upload_size
id1241903
size39,801
Peter Todorov (peterprototypes)

documentation

https://docs.rs/dontpanic

README

dontpanic

Send Rust panic!() and log::error!() messages to a backend server. See dontpanic-server

crates.io Docs License

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

at your option.

Commit count: 0

cargo fmt