#panic #error #logging #log-file

oopsie_woopsie

A crate to make debugging unexpected panics easier on end-user machines

9 stable releases

4.0.0 Sep 24, 2023
3.1.2 Jul 8, 2023
3.0.0 Jun 29, 2023
2.1.3 Jun 29, 2023
0.1.1 Jun 9, 2023

#301 in Debugging

Download history 18/week @ 2024-01-09 116/week @ 2024-02-13 72/week @ 2024-02-20 32/week @ 2024-02-27 18/week @ 2024-03-05 41/week @ 2024-03-12 24/week @ 2024-03-19 14/week @ 2024-03-26 40/week @ 2024-04-02

123 downloads per month

MIT license

9KB
109 lines

Oopsie woopsie!

A crate to make debugging unexpected panics easier both on end-user machines. Provides a panic handler which generates a helpful panic message and saves a backtrace, system information and minidump to a file. This is intended to be used only on builds that are distributed to other people.

Features

  • Displays the PanicInfo and a backtrace
  • Creates a panic log file which contains the panic message, system info, and a backtrace
  • Creates a minidump of the current process (Currently quite limited)

Usage example

fn main() {
    // Add #[cfg(not(debug_assertions))] here if you want to only enable these in release builds
    std::panic::set_hook(Box::new(|panicinfo: &std::panic::PanicInfo| {
        oopsie_woopsie::set_panic_handler(panicinfo, &oopsie_woopsie::PanicHandlerConfig{
            file_dir: Some("D:/Projects/oopsie_woopsie_test".into()),
        })
    }));

    panic!("Goodbye, world!");
}

Reminder: This crate only works for panics. It cannot debug crashes. If you need crash debugging, you need to use an out-of-process crash handler such as Breakpad or Crashpad. There is also EmbarkStudio's Crash handling utility crates.

Dependencies

~0–12MB
~106K SLoC