7 unstable releases (3 breaking)

0.4.0 Apr 12, 2024
0.3.0 Aug 7, 2023
0.2.3 Aug 7, 2023
0.2.2 Oct 27, 2022
0.1.1 Dec 1, 2021

#287 in Debugging

Download history 1022/week @ 2024-07-21 1033/week @ 2024-07-28 1175/week @ 2024-08-04 1089/week @ 2024-08-11 1272/week @ 2024-08-18 1240/week @ 2024-08-25 972/week @ 2024-09-01 842/week @ 2024-09-08 828/week @ 2024-09-15 1055/week @ 2024-09-22 1710/week @ 2024-09-29 1351/week @ 2024-10-06 1113/week @ 2024-10-13 1265/week @ 2024-10-20 572/week @ 2024-10-27 468/week @ 2024-11-03

3,471 downloads per month
Used in 6 crates

MIT/Apache

36KB
650 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.3–8MB
~53K SLoC