Log warning instead of error when failing to decode RON in storage (#2961)

* Log warning instead of error when failing to decode RON in storage

* New web demo

* Clean up some warn/error logging

* Avoid deadlock that could happen on crash

* Log errors using console.warn, because console.error can cause crashes

* Use patched version of wasm-bindgen-cli, allowing >2GB memory

* New web demo
This commit is contained in:
Emil Ernerfeldt
2023-04-27 09:45:44 +02:00
committed by GitHub
parent f76eefb98d
commit 3d6a15f442
10 changed files with 41 additions and 29 deletions
+10 -4
View File
@@ -37,7 +37,11 @@ impl log::Log for WebLogger {
log::Level::Debug => console::debug(&msg),
log::Level::Info => console::info(&msg),
log::Level::Warn => console::warn(&msg),
log::Level::Error => console::error(&msg),
// Using console.error causes crashes for unknown reason
// https://github.com/emilk/egui/pull/2961
// log::Level::Error => console::error(&msg),
log::Level::Error => console::warn(&format!("ERROR: {msg}")),
}
}
@@ -66,9 +70,11 @@ mod console {
#[wasm_bindgen(js_namespace = console)]
pub fn warn(s: &str);
/// `console.error`
#[wasm_bindgen(js_namespace = console)]
pub fn error(s: &str);
// Using console.error causes crashes for unknown reason
// https://github.com/emilk/egui/pull/2961
// /// `console.error`
// #[wasm_bindgen(js_namespace = console)]
// pub fn error(s: &str);
}
}