3 stable releases

Uses old Rust 2015

2.1.3 Aug 11, 2023
2.1.2 Aug 9, 2023

#841 in Debugging

Download history 8/week @ 2024-07-26 2/week @ 2024-08-02 12/week @ 2024-09-13 34/week @ 2024-09-20 5/week @ 2024-09-27 8/week @ 2024-10-04 7/week @ 2024-10-11

55 downloads per month

MIT/Apache

10KB
102 lines

rust-log-panics

this is a fork from rust-log-panics the difference is that this crate will als print to terminal, the reason is without this, rust integration test will not failure reason.

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:

this is a fork of log-panic, we are just keeping the writing to standard error functionality. Without it, when rust integration test failed, you can't see any failure reason printed on the terminal.

A crate which logs panics as erro using log crate as well as 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-print-panics = { version = "2", features = ["with-backtrace"]}

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

Dependencies

~0–5.5MB
~12K SLoC