Skip to main content

## install_panic_hook

# Function install_panic_hook

Source

    pub fn install_panic_hook()

Expand description

Install a panic hook that records the panic through `log::error!` before the default hook runs.

## §Why it chains rather than replaces

`utils::lock` installs a silencing hook around its own tests, which deliberately provoke poisoned locks. Replacing the current hook here would make that test output scream about panics it is intentionally causing — and, more importantly, replacing whatever hook is present is how you lose the backtrace the runtime would otherwise print.