5 unstable releases

0.3.0 Sep 3, 2024
0.2.3 Aug 31, 2024
0.2.2 Aug 24, 2024
0.2.1 Aug 23, 2024
0.1.0 May 16, 2024

#287 in Debugging

Download history 198/week @ 2024-08-18 177/week @ 2024-08-25 197/week @ 2024-09-01 5/week @ 2024-09-08 41/week @ 2024-09-15 78/week @ 2024-09-22 60/week @ 2024-09-29 59/week @ 2024-10-06 18/week @ 2024-10-13 1/week @ 2024-10-20 28/week @ 2024-11-03 95/week @ 2024-11-10

125 downloads per month

MIT/Apache

26KB
396 lines

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.

Dependencies

~4.5–6.5MB
~112K SLoC