Skip to main content

install_panic_hook

Function install_panic_hook 

Source
pub fn install_panic_hook()
Expand description

Install a panic hook that formats panics using the ConsoleTheme.

The hook prints a themed PANIC caption with the panic message and location to stderr, then calls the hook that was installed before it, so an existing crash reporter or logging hook keeps running. When no custom hook was installed, that previous hook is the standard library’s default, which prints its own panic message (and the backtrace, when RUST_BACKTRACE asks for one) after the themed lines.

§Example

error_forge::install_panic_hook();