Skip to content

Commit

Permalink
Fix review issues
Browse files Browse the repository at this point in the history
The doc references to `Level` don't resolve because `tracing-attribute`
doesn't have a direct dependency on `tracing` - not sure how to resolve
right now.
  • Loading branch information
jsgf committed Oct 17, 2022
1 parent 8e0def4 commit 592fd57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ mod expand;
/// Setting the level for the generated span:
/// ```
/// # use tracing_attributes::instrument;
/// # use tracing::Level;
/// #[instrument(level = Level::DEBUG)]
/// pub fn my_function() {
/// // ...
/// }
/// ```
/// Levels can be specifide either with `Level` constants, literal strings
/// (`"debug", etc) or numerically (1 - 5).
/// Levels can be specified either with [`Level`] constants, literal strings
/// (`"debug", etc) or numerically (1 - 5, corresponding to [`Level::TRACE`] - [`Level::ERROR`]).
///
/// Overriding the generated span's name:
/// ```
Expand Down Expand Up @@ -238,6 +239,7 @@ mod expand;
///
/// ```
/// # use tracing_attributes::instrument;
/// # use tracing::Level;
/// #[instrument(ret(level = Level::WARN))]
/// fn my_function() -> i32 {
/// 42
Expand Down Expand Up @@ -274,6 +276,7 @@ mod expand;
///
/// ```
/// # use tracing_attributes::instrument;
/// # use tracing::Level;
/// #[instrument(err(level = Level::INFO))]
/// fn my_function(arg: usize) -> Result<(), std::io::Error> {
/// Ok(())
Expand Down Expand Up @@ -372,6 +375,7 @@ mod expand;
/// [`follows_from`]: https://docs.rs/tracing/latest/tracing/struct.Span.html#method.follows_from
/// [`tracing`]: https://github.com/tokio-rs/tracing
/// [`fmt::Debug`]: std::fmt::Debug
/// [`Level`]: tracing::Level
#[proc_macro_attribute]
pub fn instrument(
args: proc_macro::TokenStream,
Expand Down

0 comments on commit 592fd57

Please sign in to comment.