mirror of
https://github.com/tokio-rs/tracing.git
synced 2026-03-26 17:40:26 +00:00
## Motivation The MIT license states: > The above copyright notice and this permission notice > shall be included in all copies or substantial portions > of the Software. ## Solution Therefore the LICENSE files should be present in each crate directory, so they are included with `cargo publish`.
tracing-attributes
Macro attributes for application-level tracing.
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.