From 20500bcf0c22768d946dd8495801b8485cc4e4af Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Sun, 12 Sep 2021 09:57:21 -0700 Subject: [PATCH] attributes: add `skip_all` (#1548) Using `#[instrument(skip_all)]` is equivalent to `#[instrument(skip(foo, bar..))]` for all the parameters. --- tracing-attributes/src/lib.rs | 4 ++-- tracing-attributes/tests/instrument.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 8bc6b0148..e972a1a23 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -161,8 +161,8 @@ mod expand; /// } /// ``` /// -/// This can be used in conjunction with `skip` to record only some fields of a -/// struct: +/// This can be used in conjunction with `skip` or `skip_all` to record only +/// some fields of a struct: /// ``` /// # use tracing_attributes::instrument; /// // Remember the struct with the very large `data` field from the earlier diff --git a/tracing-attributes/tests/instrument.rs b/tracing-attributes/tests/instrument.rs index 957567dcf..aebc903fa 100644 --- a/tracing-attributes/tests/instrument.rs +++ b/tracing-attributes/tests/instrument.rs @@ -137,6 +137,7 @@ fn skip() { with_default(collector, || { my_fn(2, UnDebug(0), UnDebug(1)); my_fn(3, UnDebug(0), UnDebug(1)); + my_fn2(2, UnDebug(0), UnDebug(1)); }); handle.assert_finished();