Crates.io | tracing-subscriber-wasm |
lib.rs | tracing-subscriber-wasm |
version | 0.1.0 |
source | src |
created_at | 2023-01-31 02:58:35.972357 |
updated_at | 2023-01-31 02:58:35.972357 |
description | A tracing-subscriber writer that writes to the console using wasm-bindgen. |
homepage | https://github.com/jquesada2016/tracing_subscriber_wasm |
repository | https://github.com/jquesada2016/tracing_subscriber_wasm |
max_upload_size | |
id | 772317 |
size | 8,218 |
A [MakeWriter
] implementation to allow directly using
[tracing_subscriber
] in the browser or with NodeJS.
The [MakeConsoleWriter
] allows mapping arbitrary trace events to
any other console verbosity level. Check out the
[MakeConsoleWriter::map_trace_level_to
] and similar methods when
building the writer.
In my testing, if you don't call .without_time
on the
subscriber builder, a runtime exception will be raised.
use tracing_subscriber::fmt;
use tracing_subscriber_wasm::MakeConsoleWriter;
fmt()
.with_writer(
// To avoide trace events in the browser from showing their
// JS backtrace, which is very annoying, in my opinion
MakeConsoleWriter::default().map_trace_level_to(tracing::Level::DEBUG),
)
// For some reason, if we don't do this in the browser, we get
// a runtime error.
.without_time()
.init();
License: MIT