pub fn init_tracing_subscriber<P: AsRef<Path>>(
datadir: P,
who: &str,
) -> Result<OtelGuard, Box<dyn Error>>
Expand description
Initialize tracing-subscriber with env filter based on RUST_LOG env variable. fmt layer is used to print logs to stdout. OpenTelemetryLayer is used to export logs to the configured OTLP endpoint. fmt layer with custom writer is used to write logs to log file in datadir.