tracing-foramtters

Crates.iotracing-foramtters
lib.rstracing-foramtters
version0.1.0
sourcesrc
created_at2022-12-15 19:42:59.097425
updated_at2022-12-15 19:42:59.097425
descriptionTracing output formatters
homepage
repositoryhttps://github.com/nebula-technologies/tracing-formatters
max_upload_size
id738279
size73,893
Anders Blenstrup-Pedersen (KatsuoRyuu)

documentation

README

Tracing Formatters

This is a simple formatting module for Tracing that allows for easily setting what type of logging output format should be used.

Formatters

There is currently implemented 2 formaters both with basic functionality, and still a work in progress.

Syslog

To use syslog the following can be done.

use tracing_logger::layer::syslog::Syslog;

let formatting_syslog = LogLayer::new(None, std::io::stdout, Syslog::default());
let subscriber = Registry::default().with(formatting_syslog);
tracing::subscriber::set_global_default(subscriber).expect("Failed to attach log subscriber");

Bunyan

To use Bunyan the following can be done.

use tracing_logger::layer::bunyan::Bunyan;

let formatting_bunyan = LogLayer::new(None, std::io::stdout, Bunyan::default());
let subscriber = Registry::default().with(formatting_bunyan);
tracing::subscriber::set_global_default(subscriber).expect("Failed to attach log subscriber");
Commit count: 0

cargo fmt