tracing-orchestra-macros

Crates.iotracing-orchestra-macros
lib.rstracing-orchestra-macros
version0.2.0
sourcesrc
created_at2023-09-07 08:07:42.307627
updated_at2023-09-12 11:58:57.556479
descriptionGive me more instruments!
homepagehttps://github.com/megumish/tracing-orchestra
repositoryhttps://github.com/megumish/tracing-orchestra.git
max_upload_size
id965941
size6,931
川田 恵氏 (Kawada Keishi a.k.a megumish) (megumish)

documentation

https://github.com/megumish/tracing-orchestra

README

tracing-orchestra

Have you ever found it tedious to attach #[tracing::instrument] to each function one by one? That's where #[tracing_orchestra::instrument] comes in!

#[tracing_orchestra::orchestra] allows you to attach what would have been #[tracing::instrument] on each function, to the impl block instead.

Installation

[dependencies]
tracing-orchestra = "0.1"

How to use

use tracing_orchestra::orchestra;

// default instrument value is here!
#[orchestra::(level = "trace")]
impl Foo {
    fn bar() {}
    // override tracing::instrument
    #[tracing::instrument(level = "info")]
    fn baz() {}
}

Features

  • Batch assignment of #[tracing::instrument] to functions.
  • Set default values for #[tracing::instrument].
    • Set default values for #[tracing::instrument].
    • Set values to override for #[tracing::instrument].
  • Automatic implementation of Debug and Display
    • Setup using the standard Derive macro for Debug and Display.
    • Configuration when you want to hide some values during tracing (e.g., sensitive information such as access tokens)

Why "orchestra"?

Because there are a lot of instruments.

License

MIT

Commit count: 13

cargo fmt