Skip to content

Commit 1ee7ba3

Browse files
committed
feat: v1.0.3
1 parent 011d63b commit 1ee7ba3

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,27 @@ cargo add instrument-level
2828

2929
This crate provides five attribute macros for different tracing log levels:
3030

31-
- `#[instrument_trace]`- Trace Level Instrumentation - Use this macro to add trace-level logging instrumentation to functions. This is the most verbose log level and automatically excludes all function arguments from span fields using `skip_all`.
31+
### `#[instrument_trace]` - Trace Level Instrumentation
3232

33-
- `#[instrument_debug]` - Debug Level Instrumentation - Use this macro to add debug-level logging instrumentation to functions. Ideal for development and debugging purposes.
33+
Use this macro to add trace-level logging instrumentation to functions. This is the most verbose log level and automatically excludes all function arguments from span fields using `skip_all`.
3434

35-
- `#[instrument_info]` - Info Level Instrumentation - Use this macro to add info-level logging instrumentation to functions. Suitable for general informational messages.
35+
### `#[instrument_debug]` - Debug Level Instrumentation
3636

37-
- `#[instrument_warn]` - Warning Level Instrumentation - Use this macro to add warning-level logging instrumentation to functions. Use for potentially harmful situations.
37+
Use this macro to add debug-level logging instrumentation to functions. Ideal for development and debugging purposes.
3838

39-
- `#[instrument_error]`- Error Level Instrumentation -Use this macro to add error-level logging instrumentation to functions. Use for error conditions that don't necessarily stop program execution. Each macro accepts optional tracing parameters such as`target`, `name`, `skip`, `fields`, etc., which can be used to customize the span behavior according to your needs.
39+
### `#[instrument_info]` - Info Level Instrumentation
40+
41+
Use this macro to add info-level logging instrumentation to functions. Suitable for general informational messages.
42+
43+
### `#[instrument_warn]` - Warning Level Instrumentation
44+
45+
Use this macro to add warning-level logging instrumentation to functions. Use for potentially harmful situations.
46+
47+
### `#[instrument_error]` - Error Level Instrumentation
48+
49+
Use this macro to add error-level logging instrumentation to functions. Use for error conditions that don't necessarily stop program execution.
50+
51+
Each macro accepts optional tracing parameters such as `target`, `name`, `skip`, `fields`, etc., which can be used to customize the span behavior according to your needs.
4052

4153
## License
4254

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ pub(crate) use syn::*;
3535
/// async fn test(x: i32, y: i32) -> i32 {
3636
/// x + y
3737
/// }
38+
///
39+
/// #[instrument_trace(skip_all)]
40+
/// async fn test_skip_all(x: i32, y: i32) -> i32 {
41+
/// x + y
42+
/// }
3843
/// ```
3944
#[proc_macro_attribute]
4045
pub fn instrument_trace(attr: TokenStream, item: TokenStream) -> TokenStream {

0 commit comments

Comments
 (0)