#tracing-wasm #logging-tracing #metrics #logging

veilid-tracing-wasm

Fork of wasm-tracing, which is a maintained fork of tracing-wasm, modified to the needs of the Veilid project. Tracing subscriber for WebAssembly.

2 unstable releases

Uses new Rust 2024

new 0.2.0 Mar 22, 2026
0.1.0 Feb 28, 2025

#437 in WebAssembly

Download history 5/week @ 2025-11-27 4/week @ 2025-12-04 1/week @ 2025-12-11 17/week @ 2025-12-18 25/week @ 2026-01-01 108/week @ 2026-01-08 10/week @ 2026-01-15 20/week @ 2026-01-22 30/week @ 2026-01-29 13/week @ 2026-02-05 31/week @ 2026-02-12 36/week @ 2026-02-19 18/week @ 2026-02-26 1/week @ 2026-03-05 8/week @ 2026-03-12

66 downloads per month
Used in 2 crates

MIT/Apache

29KB
655 lines

wasm-tracing

A maintained fork of tracing-wasm that is compatible with the latest tracing and wasm-bindgen versions.

Leverage performance profiling with your browser tools with the tracing crate.

Crates.io Documentation MIT licensed APACHE licensed

Note: wasm_tracing uses the global JavaScript console and performance objects. It will not work in environments where one or both of these are not available, such as Node.js or Cloudflare Workers.

TODOs

These features are things I'd like to do with wasm-tracing. Suggestions, comments, and complaints are encouraged! Please file an issue if you are passionate about a particular use-case or implementation detail.

  • Traces from #[tracing::instrument] macro should be visible in the console
  • Rewrite how the config works, possibly dependent/mirrored by another tracing crates' config w/ console specifics

Usage

For the simplest out of the box set-up, you can simply set wasm_tracing as your default tracing Subscriber in wasm_bindgen(start)

We have this declared in our ./src/lib.rs

#[wasm_bindgen(start)]
pub fn start() -> Result<(), JsValue> {
    // print pretty errors in wasm https://github.com/rustwasm/console_error_panic_hook
    // This is not needed for tracing_wasm to work, but it is a common tool for getting proper error line numbers for panics.
    console_error_panic_hook::set_once();

    // Add this line:
    wasm_tracing::set_as_global_default();

    Ok(())
}

Dependencies

~6–9.5MB
~92K SLoC