rustwasm / console_error_panic_hook

A panic hook for wasm32-unknown-unknown that logs panics with console.error
Apache License 2.0
326 stars 24 forks source link

Expose panic formatting as function #23

Closed kazcw closed 2 years ago

kazcw commented 2 years ago

Enso developers would like to implement a panic hook that writes to console.error, but also uses an application-specific API to write the panic info to the console running the program as an electron app. The latter is straightforward enough, but console_error_panic_hook's formatting addresses browser subtleties, and we'd prefer not to duplicate that.

This PR exposes panic formatting in the API, for use from custom panic hooks.

kazcw commented 2 years ago

Oops, I meant to PR this to Enso's fork. I intend to propose the change here after completing review of the changes within our org.