emit_web
Use emit in WebAssembly applications targeting NodeJS and the browser.
Getting started
First, add emit and emit_web to your Cargo.toml:
[]
= "0.11"
# Important: Make sure you set `default-features = false`
= false
= ["std", "implicit_rt"]
[]
= "0.1.0"
Ensure you set default-features = false on emit, so it won't try compile dependencies that aren't compatible with WebAssembly.
Next, configure emit to use web APIs in its runtime:
use *;
The name of this function doesn't matter, you'll just need to call it somewhere early in your application. You'll need to at least override the default clock and source of randomness, otherwise you'll get events without timestamps, and spans without ids.
Output
emit_web will output events to the Console API, where they'll appear in browser dev tools.
