instrument_warn

Attribute Macro instrument_warn 

Source
#[instrument_warn]
Expand description

Enables warn-level instrumentation for the decorated function.

This attribute macro wraps the function with #[::tracing::instrument(level = "warn")], enabling automatic tracing instrumentation at the warn level.

§Arguments

  • attr - Additional tracing instrument parameters (optional): target, name, skip, fields, etc.
  • item - The TokenStream representing the function to be instrumented.

§Returns

Returns the expanded TokenStream with tracing instrumentation applied.

§Examples

use tracing;
use instrument_level::*;

#[instrument_warn]
async fn test(x: i32, y: i32) -> i32 {
    x + y
}

#[instrument_warn(skip_all)]
async fn test_skip_all(x: i32, y: i32) -> i32 {
    x + y
}