#error

log-panics

A panic hook which logs panic messages rather than printing them

5 stable releases

Uses old Rust 2015

2.1.0 Jul 16, 2022
2.0.0 Dec 25, 2017
1.2.0 Aug 5, 2017
1.1.0 Dec 10, 2016
1.0.0 Jul 20, 2016

#108 in Rust patterns

Download history 30232/week @ 2024-06-11 29556/week @ 2024-06-18 26761/week @ 2024-06-25 25195/week @ 2024-07-02 28655/week @ 2024-07-09 33077/week @ 2024-07-16 36028/week @ 2024-07-23 36391/week @ 2024-07-30 38193/week @ 2024-08-06 40318/week @ 2024-08-13 40952/week @ 2024-08-20 41227/week @ 2024-08-27 41939/week @ 2024-09-03 39231/week @ 2024-09-10 35501/week @ 2024-09-17 37655/week @ 2024-09-24

161,062 downloads per month
Used in 73 crates (42 directly)

MIT/Apache

10KB
98 lines

rust-log-panics

CircleCI

Documentation

A panic hook which logs panics rather than printing them.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

A crate which logs panics instead of writing to standard error.

The format used is identical to the standard library's.

Because logging with a backtrace requires additional dependencies, the with-backtrace feature must be enabled. You can add the following in your Cargo.toml:

log-panics = { version = "2", features = ["with-backtrace"]}

To use, call log_panics::init() somewhere early in execution, such as immediately after initializing log, or use the Config builder for more customization.

Dependencies

~0–5MB
~12K SLoC