#tracing #android #stdio

tracing-fmt-smart-writer

Smart writer for tracing-subscriber's fmt module

2 unstable releases

0.3.0 Feb 22, 2023
0.2.0 Jul 14, 2021

#490 in Debugging

BSL-1.0 license

10KB
131 lines

tracing-fmt-smart-writer

Crates.io Documentation Build

Smarter writer builder for tracing-subscriber's fmt module Version corresponds to major tracing-subscriber version.

Usage

use tracing_fmt_smart_writer::{WriterBuilder, tracing_subscriber};

tracing_subscriber::fmt::Subscriber::builder().with_writer(WriterBuilder::new())
                                              .init();

Platform selection

Android

Writes into logcat

Level map (tracing to logcat)
  • ERROR -> ERROR;
  • WARN -> WARN;
  • INFO -> INFO;
  • DEBUG -> DEBUG;
  • TRACE -> VERBOSE;

Web

Writes using console

Level map (tracing to console)
  • ERROR -> console.error;
  • WARN -> console.warn;
  • INFO -> console.info;
  • DEBUG -> console.debug;
  • TRACE -> console.debug;

Others

Writes into stdout

Dependencies

~0.8–1.1MB
~19K SLoC