#tracing #ansi #glog

tracing-glog

a glog-inspired formatter for tracing-subscriber

6 releases

0.3.0 Aug 7, 2023
0.2.3 Aug 7, 2023
0.2.2 Oct 27, 2022
0.2.0 Jun 7, 2022
0.1.1 Dec 1, 2021

#132 in Configuration

Download history 136/week @ 2023-07-19 181/week @ 2023-07-26 407/week @ 2023-08-02 511/week @ 2023-08-09 519/week @ 2023-08-16 454/week @ 2023-08-23 242/week @ 2023-08-30 537/week @ 2023-09-06 248/week @ 2023-09-13 246/week @ 2023-09-20 212/week @ 2023-09-27 215/week @ 2023-10-04 326/week @ 2023-10-11 388/week @ 2023-10-18 214/week @ 2023-10-25 208/week @ 2023-11-01

1,195 downloads per month
Used in 3 crates

MIT/Apache

33KB
590 lines

tracing-glog

tracing-glog is a glog-inspired formatter for tracing-subscriber.

tracing-glog should be used with tracing-subscriber, as it is a formatter that tracing-subscriber's fmt::Subscriber and fmt::Layer can use to format events in a glog-inspired fashion.

Examples

With fmt::Subscriber:

use tracing_glog::{Glog, GlogFields};

tracing_subscriber::fmt()
    .event_format(Glog::default())
    .fmt_fields(GlogFields::default())
    .init();

With tracing_subscriber::fmt::Layer:

use tracing_subscriber::prelude::*;
use tracing_subscriber::{fmt, Registry};
use tracing_glog::{Glog, GlogFields};

let fmt = fmt::Layer::default()
    .event_format(Glog::default())
    .fmt_fields(GlogFields::default());

let subscriber = Registry::default().with(fmt);
tracing::subscriber::set_global_default(subscriber).expect("Unable to set global subscriber");

Dependencies

~2.5MB
~39K SLoC