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
161,062 downloads per month
Used in 73 crates
(42 directly)
10KB
98 lines
rust-log-panics
A panic hook which logs panics rather than printing them.
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.
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