Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tracing-attributes/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,13 @@ impl RecordType {
"i32",
"u64",
"i64",
"u128",
"i128",
"f32",
"f64",
"usize",
"isize",
"String",
"NonZeroU8",
"NonZeroI8",
"NonZeroU16",
Expand All @@ -434,6 +437,8 @@ impl RecordType {
"NonZeroI32",
"NonZeroU64",
"NonZeroI64",
"NonZeroU128",
"NonZeroI128",
"NonZeroUsize",
"NonZeroIsize",
"Wrapping",
Expand Down
8 changes: 5 additions & 3 deletions tracing-attributes/tests/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn override_everything() {
#[test]
fn fields() {
#[instrument(target = "my_target", level = "debug")]
fn my_fn(arg1: usize, arg2: bool) {}
fn my_fn(arg1: usize, arg2: bool, arg3: String) {}

let span = expect::span()
.named("my_fn")
Expand All @@ -68,6 +68,7 @@ fn fields() {
expect::field("arg1")
.with_value(&2usize)
.and(expect::field("arg2").with_value(&false))
.and(expect::field("arg3").with_value(&"Cool".to_string()))
.only(),
),
)
Expand All @@ -79,6 +80,7 @@ fn fields() {
expect::field("arg1")
.with_value(&3usize)
.and(expect::field("arg2").with_value(&true))
.and(expect::field("arg3").with_value(&"Still Cool".to_string()))
.only(),
),
)
Expand All @@ -89,8 +91,8 @@ fn fields() {
.run_with_handle();

with_default(collector, || {
my_fn(2, false);
my_fn(3, true);
my_fn(2, false, "Cool".to_string());
my_fn(3, true, "Still Cool".to_string());
});

handle.assert_finished();
Expand Down