Function try_set_as_global_default

Source
pub fn try_set_as_global_default() -> Result<(), SetGlobalDefaultError>
Expand description

Set WASM to be the default layer for a Registry via tracing::subscriber::set_global_default.

ยงExample

use console_error_panic_hook;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn start() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();

    wasm_tracing::try_set_as_global_default();

    Ok(())
}