tracing/tracing-attributes
Simon THOBY 9ae4676054
attributes: support use of the 'self' variable in async-trait contexts (#875)
##  Motivation

Fixes #864.

## Solution

Visit the fields and replace 'self' with '_self', and 'Self' with the
type of the impl (when we can acces it, see
https://github.com/tokio-rs/tracing/issues/864#issuecomment-667508801
for current limitations).
2020-08-07 11:46:26 -07:00
..

tracing-attributes

Macro attributes for application-level tracing.

Crates.io Documentation Documentation (master) MIT licensed Build Status Discord chat

Documentation | Chat

Overview

tracing is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. This crate provides the #[instrument] attribute for automatically instrumenting functions using tracing.

Note that this macro is also re-exported by the main tracing crate.

Usage

First, add this to your Cargo.toml:

[dependencies]
tracing-attributes = "0.1.9"

Compiler support: requires rustc 1.39+

This crate provides the #[instrument] attribute for instrumenting a function with a tracing span. For example:

use tracing_attributes::instrument;

#[instrument]
pub fn my_function(my_arg: usize) {
    // ...
}

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.