Registry / logging / tracing-wasm

tracing-wasm

JSON →
library0.2.1rscratesunverified

A tracing subscriber for browser WebAssembly environments.

# Cargo.toml [dependencies] tracing-wasm = "0.2.1"
INSTALL
IMPORT
SIG · TRACING-WASM
T
tracing-wasm
loggingrustv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WASMLayer
use tracing_wasm::WASMLayer;

Initializes the WASM tracing subscriber to forward logs to the browser console.

use tracing_wasm::WASMLayer; use tracing_subscriber::prelude::*; fn main() { tracing_subscriber::registry() .with(WASMLayer::default()) .init(); tracing::info!("Hello from WASM!"); }
Debug
Known issues
gotchaOnly works in WebAssembly targets; will panic on native platforms.
fix
Use conditional compilation with #[cfg(target_arch = "wasm32")].
affects: >=0.2.0
Upgrade
Version history
0.2.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
45
OpenAI (training)
1
Resources
tracing-wasm — cargo add tracing-wasm · libregistry