tracing-browser-subscriber

Crates.iotracing-browser-subscriber
lib.rstracing-browser-subscriber
version0.2.0
sourcesrc
created_at2022-07-20 22:13:10.273633
updated_at2022-11-20 01:21:48.685825
descriptionA tracing subscriber for the browser and webassembly
homepage
repository
max_upload_size
id629201
size15,409
Jeremy Wall (zaphar)

documentation

README

tracing-browser-subscriber

This implements a minimal tracing subscriber for use in browser/webassembly. It allows you to use tracing in the browser to log as well as record timings for spans. At the time of writing it differs from tracing-wasm in the following ways.

  • It does not support colors in the log output.
  • It does not mark or measure events in the browser performance data only spans.
  • It use the console error, warn, info, debug, and trace mechanism to record logs.

If the above features/restrictions do not appeal to you you may want to use tracing-wasm instead.

Example

use tracing_browser_subscriber;
use wasm_bindgen::prelude::wasm_bindgen;

#[wasm_bindgen(start)]
fn main() {
    tracing_browser_subscriber::configure_as_global_default();
    // Rest of our webassembly code goes here
}
Commit count: 0

cargo fmt