#development-tools

nightly visualpanic-rs

A library providing a panic hook for Rust applications that visualizes the panic with a native error dialog on supported systems

3 releases

0.1.2 Nov 21, 2023
0.1.1 Nov 21, 2023
0.1.0 Nov 21, 2023

#1334 in Debugging

MIT license

9KB
79 lines

VisualPanic

Visualize panics with native GUI dialogs on supported systems (see list at https://crates.io/crates/native-dialog).

Provides a solution to panic visually, useful for GUI applications where a console view might not be available at all times. Customizable in some ways, e.g., which icon, title and dialog level should be used.

Example 1: Use the default settings and register for the whole application

fn main() {
    VisualPanic::default().register_global();
}

Example 2: Use custom settings and register for the whole application

fn main() {
    VisualPanic::new(
        Some("path/to/custom_icon.png"),
        Some("Custom Title"),
        Some(VisualPanicLevel::Info))
    .register_global();
}

VisualPanic (visualpanic-rs)

Crates.io License

A library providing a panic hook for Rust applications that visualizes the panic with a native error dialog on supported systems (see listed OSes at native-dialog).

Installation

cargo add visualpanic_rs

Example 1: Use the default settings and register for the whole application

use visualpanic_rs::VisualPanic;
fn main() {
     VisualPanic::default().register_global();
}

Example 2: Use custom settings and register for the whole application

use visualpanic_rs::VisualPanic;
use visualpanic_rs::VisualPanicLevel;
fn main() {
     VisualPanic::new(
         Some("path/to/custom_icon.png"),
         Some("Custom Title"),
         Some(VisualPanicLevel::Info))
     .register_global();
}

Dependencies

~0.5–14MB
~145K SLoC