From 0e615d1a83c45c6834c6b6fa013cc412760496f2 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 20 Jul 2022 18:09:01 -0400 Subject: [PATCH] Add a Readme --- Readme.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..48b46e1 --- /dev/null +++ b/Readme.md @@ -0,0 +1,40 @@ + + +# tracing-browser-subscriber + +This implements a minimal [tracing](https://crates.io/crates/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](https://crates.io/crates/tracing) 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 + +```rust +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 +} +``` \ No newline at end of file