Expand description
A tracing compatible subscriber layer for web platforms.
§Example usage
use tracing_web::{MakeWebConsoleWriter, performance_layer};
use tracing_subscriber::fmt::format::Pretty;
use tracing_subscriber::fmt::time::UtcTime;
use tracing_subscriber::prelude::*;
let fmt_layer = tracing_subscriber::fmt::layer()
.with_ansi(false) // Only partially supported across browsers
.without_time() // std::time is not available in browsers
.with_writer(MakeWebConsoleWriter::new()); // write events to the console
let perf_layer = performance_layer().with_details_from_fields(Pretty::default());
tracing_subscriber::registry()
.with(fmt_layer)
.with(perf_layer)
.init();Structs§
- Console
Writer - Concrete
std::io::Writeimplementation returned byMakeConsoleWriterandMakeWebConsoleWriter. - Format
Span From Fields - An adaptor for Formatters from
tracing_subscriber::fmt::formatas aFormatSpan. - Make
Console Writer - Discouraged A
MakeWriteremitting the written text to theconsole. - Make
WebConsole Writer - A
MakeWriteremitting the written text to theconsole. - Performance
Events Layer - A
Layerthat emits span enter, exit and events asperformancemarks.
Traits§
- Format
Span - Determine what additional information will be attached to the performance events.
Functions§
- performance_
layer - Construct a new layer recording performance events.