tracing-formatters

Crates.iotracing-formatters
lib.rstracing-formatters
version0.0.1
sourcesrc
created_at2022-12-15 20:15:01.512166
updated_at2022-12-15 20:15:01.512166
descriptionTracing output formatters
homepage
repositoryhttps://github.com/nebula-technologies/tracing-formatters
max_upload_size
id738295
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