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

Overview

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");
Comments
  • feat: add a toggle for span context

    feat: add a toggle for span context

    This branch adds an off-by-default toggle that disables the span context, as some new Rust/tracing users have found the span context to be overwhelming.

    opened by davidbarsky 2
  • Add support for non-UTC timezones

    Add support for non-UTC timezones

    This diff makes it possible to provide custom timezones to the glog formatter, such as chrono::Local.

    It keeps Glog::default() the same, so it should be backwards compatible.

    opened by chriskonstad 2
  • Make ansi colour rendering optional

    Make ansi colour rendering optional

    Add an ansi feature (enabled by default) which enables styled output; without this the glog output is plain. Removing it also removes the dependency on nu-ansi-term.

    Since glog is primarily used to interoperate with other tools which can consume glog-formatted files, styled output is generally undesireable since those other tools could be confused by embedded ansi sequences. In general glog is not a great format for direct user presentation - there are lots of other options.

    opened by jsgf 1
  • Normalize event metadata if coming from tracing-log

    Normalize event metadata if coming from tracing-log

    Add tracing-log feature which will use tracing-log's NormalizeEvent trait to re-insert file and line info that's missing from the original callsite metadata.

    opened by jsgf 0
  • Put space between `]` and rest of log line

    Put space between `]` and rest of log line

    Previously:

    I1013 00:10:23.280450 2557418 cip/hallmark/service/main.rs:207]started serve_background
    

    Now:

    I1013 00:10:23.280450 2557418 cip/hallmark/service/main.rs:207] started serve_background
    

    This matches glog's formatting.

    opened by jsgf 0
  • feature: Add Toggle for Threads Names and Targets

    feature: Add Toggle for Threads Names and Targets

    (builds on #1. Will rebase once that is merged.)

    This PR adds:

    • a builder toggle on Glog to enable/disable thread names and targets, as glog does not have this information enabled by default.
    • an example of tracing-glog used with Tokio; pilfered from https://github.com/tokio-rs/tracing/blob/master/examples/examples/tokio-spawny-thing.rs.

    Still to do: docs.

    opened by davidbarsky 0
Releases(v0.2.2)
  • v0.2.2(Oct 27, 2022)

    What's Changed

    • Make ansi colour rendering optional by @jsgf in https://github.com/davidbarsky/tracing-glog/pull/9
    • Fix !ansi compilation by @jsgf in https://github.com/davidbarsky/tracing-glog/pull/11
    • Normalize event metadata if coming from tracing-log by @jsgf in https://github.com/davidbarsky/tracing-glog/pull/12

    Full Changelog: https://github.com/davidbarsky/tracing-glog/compare/v0.2.1...v0.2.2


    crates.io: https://crates.io/crates/tracing-glog/0.2.2 docs.rs: https://docs.rs/tracing-glog/0.2.2/

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Oct 13, 2022)

    What's Changed

    • chore: switch to nu-ansi-term from ansi-term by @davidbarsky in https://github.com/davidbarsky/tracing-glog/pull/6
    • Put space between ] and rest of log line by @jsgf in https://github.com/davidbarsky/tracing-glog/pull/7

    New Contributors

    • @jsgf made their first contribution in https://github.com/davidbarsky/tracing-glog/pull/7

    Full Changelog: https://github.com/davidbarsky/tracing-glog/compare/v0.2.0...v0.2.1


    • crates.io: https://crates.io/crates/tracing-glog
    • docs.rs: https://docs.rs/tracing-glog/0.2.1/tracing_glog/index.html
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jun 7, 2022)

    What's Changed

    • feature: add support for non-UTC timezones by @chriskonstad (#1)
    • feature: add a toggle for span context (#2)
    • feature(breaking): add toggle for threads names and target; default off. (#3)
    • chore: add Github Actions (#4)

    Full Changelog: https://github.com/davidbarsky/tracing-glog/commits/v0.2.0


    • crates.io: https://crates.io/crates/tracing-glog
    • docs.rs: https://docs.rs/tracing-glog/0.2.0/tracing_glog/index.html
    Source code(tar.gz)
    Source code(zip)
Owner
David Barsky
David Barsky
A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them

Datadog Formatting Layer A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them. Features Provides a layer for t

Open Schnick 4 Jun 22, 2023
A rust `tracing` compatible framework inspired by log4rs.

trace4rs This crate allows users to configure output from tracing in the same way as you would configure the output of log4rs. Overview For a usage ex

Imperva 5 Oct 24, 2022
Transmute - a binary that works alone or in coordination with coverage formatter to report test quality

Transmute is a binary that works alone or in coordination with coverage formatter to report test quality. It will change your code and make the tests fail. If don't, we will raise it for you.

Victor Antoniazzi 5 Nov 17, 2022
Error propagation tracing in Rust.

Propagate Error propagation tracing in Rust. Why Propagate? Being able to trace the cause of an error is critical for many types of software written i

Ben Reeves 10 Sep 23, 2021
This crate bridges between gstreamer and tracing ecosystems.

This crate provides a bridge between gstreamer and the tracing ecosystem. The goal is to allow Rust applications utilizing GStreamer to better integra

Standard Cognition OSS 17 Jun 7, 2022
A tracing profiler for the Sega MegaDrive/Genesis

md-profiler, a tracing profiler for the Sega MegaDrive/Genesis This program, meant to be used with this fork of BlastEm, helps you finding bottlenecks

null 15 Nov 3, 2022
A tracing layer for macOS/iOS's `oslog`

tracing_oslog This is a tracing layer for the Apple OS logging framework. Activities are used to handle spans, Example use tracing_oslog::OsLogger; l

Lucy 12 Dec 6, 2022
Emit ETW events in tracing-enabled Rust applications.

tracing-etw Emit ETW events in tracing-enabled Rust applications. This crate depends on rust_win_etw. There are four ETW events. fn NewSpan(span_id: u

Microsoft 11 Aug 10, 2022
A patch to fix tracing LocalTime problem.

tracing-local-time A patch to fix tracing LocalTime problem. Tracing-subscriber now has a bug in LocalTime, so build ourselves' to fix it. In this pat

Cris Liao 2 Dec 27, 2021
An example of a fairing for rocket to use tracing (as this pops up at many places in dicussions and questions)

Rocket Tracing Fairing Example This repository aims to give a short example of how you can add a Fairing to your Rocket for tracing and how to use it

Christof Weickhardt 9 Nov 23, 2022
A dynamic binary tracing tool

Backlight Backlight is a dynamic binary tracing tool. Install $ git clone [email protected]:JoshMcguigan/backlight.git $ cd backlight $ cargo install-b

Josh Mcguigan 42 Dec 3, 2022
Tracing layer to quickly inspect spans and events

tracing-texray First, a word of warning: This is alpha software. Don't run this in prod or anywhere where a panic would ruin your day. tracing-texray

Russell Cohen 23 Dec 3, 2022
tracing - a framework for instrumenting Rust programs to collect structured, event-based diagnostic information

tracing-appender Writers for logging events and spans Documentation | Chat Overview tracing is a framework for instrumenting Rust programs to collect

Cris Liao 1 Mar 9, 2022
Middlewares and tools to integrate axum + tracing + opentelemetry

axum-tracing-opentelemetry Middlewares and tools to integrate axum + tracing + opentelemetry. Read OpenTelemetry header from incoming request Start a

David Bernard 31 Jan 4, 2023
A convenient tracing config and init lib, with symlinking and local timezone.

clia-tracing-config A convenient tracing config and init lib, with symlinking and local timezone. Use these formats default, and can be configured: pr

Cris Liao 5 Jan 3, 2023
High-performance QEMU memory and instruction tracing

Cannoli Cannoli is a high-performance tracing engine for qemu-user. It can record a trace of both PCs executed, as well as memory operations. It consi

Margin Research 412 Oct 18, 2023
Utilities for integrating Datadog with opentelemetry + tracing in rust

Non-official datadog tracing and log correlation for Rust services. This crate contains the necessary glue to bridge the gap between OpenTelemetry, tr

willbank 5 Oct 31, 2023
runs init, preview and apply on pulumi stacks right in your Github Actions. Inspired from Atalantis for Terraform

pulumi-actions runs init, preview and apply on pulumi stacks right in your Github-Actions. Inspired from Atlantis for Terraform PREVIEW Release Curren

Meet Vasani 6 Aug 7, 2023
AWS Cloudwatch layer for tracing-subscriber

tracing-cloudwatch tracing-cloudwatch is a custom tracing-subscriber layer that sends your application's tracing events(logs) to AWS CloudWatch Logs.

ymgyt 7 May 14, 2023
A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them

Datadog Formatting Layer A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them. Features Provides a layer for t

Open Schnick 4 Jun 22, 2023