Registry / logging / wasm-logger

wasm-logger

JSON →
library0.2.0rscratesunverified

A logger that sends Rust log messages with source line and filename to the browser console.

# Cargo.toml [dependencies] wasm-logger = "0.2.0"
INSTALL
IMPORT
SIG · WASM-LOGGER
W
wasm-logger
loggingrustv0.2.0
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.

init
use wasm_logger::init;

Initialize the wasm-logger to forward log messages to the browser console.

use wasm_logger::init; use log::info; fn main() { init(wasm_logger::Config::default()); info!("Hello from WebAssembly!"); }
Debug
Known issues
gotchaOnly works in WebAssembly targets; will panic if used outside a browser environment.
fix
Conditionally compile with cfg(target_arch = "wasm32") or use a fallback logger for non-WASM targets.
affects: >=0.2.0
Upgrade
Version history
0.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
48
Resources
wasm-logger — cargo add wasm-logger · libregistry