Skip to content

Commit f03c612

Browse files
kaffarelldavidbarsky
authored andcommitted
attributes: added missing RecordTypes for instrument (#2781)
When using a function annotated with `#[instrument]` it parses the parameters of the function and records them either using `Value` or using `std::fmt::Debug`. There were a few types that implement `Value` but were missing the RecordTypes array. Added them + a unit test for a single one. Fixed: #2775
1 parent 56fc2e5 commit f03c612

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tracing-attributes/tests/instrument.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fn override_everything() {
5252
fn fields() {
5353
#[instrument(target = "my_target", level = "debug")]
5454
fn my_fn(arg1: usize, arg2: bool, arg3: String) {}
55+
fn my_fn(arg1: usize, arg2: bool, arg3: String) {}
5556

5657
let span = expect::span()
5758
.named("my_fn")
@@ -69,6 +70,7 @@ fn fields() {
6970
.with_value(&2usize)
7071
.and(expect::field("arg2").with_value(&false))
7172
.and(expect::field("arg3").with_value(&"Cool".to_string()))
73+
.and(expect::field("arg3").with_value(&"Cool".to_string()))
7274
.only(),
7375
),
7476
)
@@ -81,6 +83,7 @@ fn fields() {
8183
.with_value(&3usize)
8284
.and(expect::field("arg2").with_value(&true))
8385
.and(expect::field("arg3").with_value(&"Still Cool".to_string()))
86+
.and(expect::field("arg3").with_value(&"Still Cool".to_string()))
8487
.only(),
8588
),
8689
)
@@ -90,7 +93,7 @@ fn fields() {
9093
.only()
9194
.run_with_handle();
9295

93-
with_default(collector, || {
96+
with_default(subscriber, || {
9497
my_fn(2, false, "Cool".to_string());
9598
my_fn(3, true, "Still Cool".to_string());
9699
});

0 commit comments

Comments
 (0)