Skip to content

Commit d99f86d

Browse files
committed
Initialize console_log in debug mode
1 parent 82e516d commit d99f86d

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/web/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ crate-type = ["cdylib"]
1010
[dependencies]
1111
by_address = "1"
1212
console_error_panic_hook = { version = "0.1", optional = true }
13+
console_log = { version = "1", optional = true }
1314
enumset = "1"
1415
indexmap = "2"
1516
js-sys = "0.3"
@@ -24,4 +25,4 @@ wasm-bindgen = "=0.2.87" # Must be this version of wbg
2425

2526
[features]
2627
default = ["debug"]
27-
debug = ["dep:console_error_panic_hook"]
28+
debug = ["dep:console_error_panic_hook", "dep:console_log"]

crates/web/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use wasm_bindgen::prelude::{wasm_bindgen, JsError, JsValue};
1616
#[wasm_bindgen]
1717
pub fn initialize() {
1818
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
19+
console_log::init().unwrap();
1920
}
2021

2122
fn to_js_value(value: &impl Serialize) -> Result<JsValue, serde_wasm_bindgen::Error> {

0 commit comments

Comments
 (0)