Files
ic10emu/ic10emu_wasm/src/utils.rs
Rachel baf67b2c6a Vm working. simple interface built
- still need stack view
- still ned to work with devices
2024-03-28 01:31:09 -07:00

25 lines
753 B
Rust

pub fn set_panic_hook() {
// When the `console_error_panic_hook` feature is enabled, we can call the
// `set_panic_hook` function at least once during initialization, and then
// we will get better error messages if our code ever panics.
//
// For more details see
// https://github.com/rustwasm/console_error_panic_hook#readme
#[cfg(feature = "console_error_panic_hook")]
{
console_error_panic_hook::set_once();
web_sys::console::log_1(&format!("Panic hook set...").into());
}
}
extern crate web_sys;
// A macro to provide `println!(..)`-style syntax for `console.log` logging.
macro_rules! log {
( $( $t:tt )* ) => {
web_sys::console::log_1(&format!( $( $t )* ).into());
}
}