3 stable releases

Uses old Rust 2015

2.1.3 Aug 11, 2023
2.1.2 Aug 9, 2023

#709 in Debugging

48 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

~46–620KB
~12K SLoC