tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.52k stars 725 forks source link

attributes: globally qualify attribute paths #3127

Open heaths opened 3 weeks ago

heaths commented 3 weeks ago

Avoid ambiguities with any user-defined tracing modules by globally qualifying types used in the attribute-generated code e.g., ::tracing::Level.

Fixes: #3119 for the v0.1.x crate versions.

Motivation

We need to define helper functions for tracing within our own crates, and tracing is too good a name to pass up. Our helpers will mostly wrap and otherwise "hide" the tracing crate, but when using #[instrument] the generated code conflicts with our tracing module.

Solution

Globally qualify any token paths e.g., ::tracing to avoid ambiguities.