kithara-platform 0.0.1-alpha4

Cross-platform primitives (sync, time, thread) for native and wasm32.
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Emit an error-level diagnostic line through the platform-appropriate sink.
///
/// On native this routes through `tracing`. On wasm it writes to the browser
/// `console` directly rather than through the global `tracing` subscriber: on
/// a non-main wasm instance (e.g. the audio worklet) that subscriber is a
/// `dyn` object whose vtable lives in the main instance's function table, so
/// dispatching to it cross-instance would trap. `console.error` is a per-realm
/// import that is valid in every scope, including `AudioWorkletGlobalScope`.
pub fn log_error(msg: &str) {
    web_sys::console::error_1(&wasm_bindgen::JsValue::from_str(msg));
}