Expand description

A tracing compatible subscriber layer for web platforms.

Example usage

use tracing_web::{MakeConsoleWriter, 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
    .with_timer(UtcTime::rfc_3339()) // std::time is not available in browsers
    .with_writer(MakeConsoleWriter); // write events to the console
let perf_layer = performance_layer().with_details_from_fields(Pretty::default());



Concrete std::io::Write implementation returned from MakeConsoleWriter.

A MakeWriter emitting the written text to the console.

A Layer that emits span enter, exit and events as performance marks.


Determine what additional information will be attached to the performance events.


Construct a new layer recording performance events.