Skip to content

wit-bindgen: Don't trace values containing lists by default.#9262

Merged
alexcrichton merged 4 commits intobytecodealliance:mainfrom
sunfishcode:sunfishcode/verbose-tracing
Sep 17, 2024
Merged

wit-bindgen: Don't trace values containing lists by default.#9262
alexcrichton merged 4 commits intobytecodealliance:mainfrom
sunfishcode:sunfishcode/verbose-tracing

Conversation

@sunfishcode
Copy link
Copy Markdown
Member

list values in Wit interfaces can represent things like HTTP bodies which can be very large. To enable tracing without spamming logfiles with all this data, put printing of values containing lists behind a separate verbose_tracing option.

This is a coarse-grained approach; but it seems like a pretty good default for tracing, and enabling full tracing when one needs it is straightforward.

In the future, we may want to refine the option by implementing the Valuable trait and using tracing::field::valuable, which could allow us to do things like print non-list fields of records that otherwise contain lists.

@sunfishcode sunfishcode requested a review from a team as a code owner September 16, 2024 23:35
@sunfishcode sunfishcode requested review from fitzgen and removed request for a team September 16, 2024 23:35
`list` values in Wit interfaces can represent things like HTTP bodies
which can be very large. To enable tracing without spamming logfiles
with all this data, put printing of values containing `list`s behind
a separate `verbose_tracing` option.

This is a coarse-grained approach; but it seems like a pretty good
default for tracing, and enabling full tracing when one needs it is
straightforward.

In the future, we may want to refine the option by implementing
the `Valuable` trait and using `tracing::field::valuable`, which
could allow us to do things like print non-`list` fields of records
that otherwise contain `list`s.
@sunfishcode sunfishcode force-pushed the sunfishcode/verbose-tracing branch from c35dcd5 to 27986c3 Compare September 17, 2024 17:00
@alexcrichton alexcrichton added this pull request to the merge queue Sep 17, 2024
Merged via the queue into bytecodealliance:main with commit e38ffa1 Sep 17, 2024
@sunfishcode sunfishcode deleted the sunfishcode/verbose-tracing branch September 17, 2024 20:40
elliottt pushed a commit to elliottt/wasmtime that referenced this pull request Sep 17, 2024
…ealliance#9262)

* wit-bindgen: Don't trace values containing lists by default.

`list` values in Wit interfaces can represent things like HTTP bodies
which can be very large. To enable tracing without spamming logfiles
with all this data, put printing of values containing `list`s behind
a separate `verbose_tracing` option.

This is a coarse-grained approach; but it seems like a pretty good
default for tracing, and enabling full tracing when one needs it is
straightforward.

In the future, we may want to refine the option by implementing
the `Valuable` trait and using `tracing::field::valuable`, which
could allow us to do things like print non-`list` fields of records
that otherwise contain `list`s.

* Use `option_type_contains_lists` more.

* Hook up `verbose_tracing` to the macro.

* Update expected outputs for tests.
alexcrichton pushed a commit that referenced this pull request Sep 17, 2024
* wit-bindgen: Don't trace values containing lists by default. (#9262)

* wit-bindgen: Don't trace values containing lists by default.

`list` values in Wit interfaces can represent things like HTTP bodies
which can be very large. To enable tracing without spamming logfiles
with all this data, put printing of values containing `list`s behind
a separate `verbose_tracing` option.

This is a coarse-grained approach; but it seems like a pretty good
default for tracing, and enabling full tracing when one needs it is
straightforward.

In the future, we may want to refine the option by implementing
the `Valuable` trait and using `tracing::field::valuable`, which
could allow us to do things like print non-`list` fields of records
that otherwise contain `list`s.

* Use `option_type_contains_lists` more.

* Hook up `verbose_tracing` to the macro.

* Update expected outputs for tests.

* Add release notes

---------

Co-authored-by: Dan Gohman <dev@sunfishcode.online>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants