3 pub fn set_panic_hook() {
4 // When the `console_error_panic_hook` feature is enabled, we can call the
5 // `set_panic_hook` function at least once during initialization, and then
6 // we will get better error messages if our code ever panics.
8 // For more details see
9 // https://github.com/rustwasm/console_error_panic_hook#readme
10 #[cfg(feature = "console_error_panic_hook")]
11 console_error_panic_hook
::set_once();
15 macro_rules
! console_log
{
16 // Note that this is using the `log` function imported above during
18 ($
($t
:tt
)*) => (console
::log_1(&format_args!($
($t
)*).to_string().into()))