remove tracing-wasm

This commit is contained in:
Simon Gardling 2022-03-03 13:03:53 -05:00
parent b12788a51c
commit 65b0ce7db6
2 changed files with 0 additions and 16 deletions

View File

@ -39,4 +39,3 @@ instant = { version = "0.1.12", features = ["wasm-bindgen"] }
console_error_panic_hook = "0.1.7" console_error_panic_hook = "0.1.7"
wee_alloc = "0.4.5" wee_alloc = "0.4.5"
wasm-bindgen = { version = "0.2.79", default-features = false, features = ["std"] } wasm-bindgen = { version = "0.2.79", default-features = false, features = ["std"] }
tracing-wasm = "0.2.1"

View File

@ -15,26 +15,11 @@ use wasm_bindgen::prelude::*;
#[global_allocator] #[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[cfg(target_arch = "wasm32")]
#[cfg(debug_assertions)]
fn init_tracing_wasm() {
log_helper("Initializing tracing_wasm...");
tracing_wasm::set_as_global_default();
log_helper("Initialized tracing_wasm!");
}
#[cfg(target_arch = "wasm32")]
#[cfg(not(debug_assertions))]
fn init_tracing_wasm() {}
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
#[wasm_bindgen] #[wasm_bindgen]
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> { pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
log_helper("Initializing..."); log_helper("Initializing...");
// See performance in browser profiler!
init_tracing_wasm();
// Used in order to hook into `panic!()` to log in the browser's console // Used in order to hook into `panic!()` to log in the browser's console
log_helper("Initializing panic hooks..."); log_helper("Initializing panic hooks...");
std::panic::set_hook(Box::new(console_error_panic_hook::hook)); std::panic::set_hook(Box::new(console_error_panic_hook::hook));