tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.14k stars 671 forks source link

subscriber: skip padding when skipping `log.*` fields in `DefaultVisitor` #2980

Open Porges opened 1 month ago

Porges commented 1 month ago

Motivation

Closes #2979.

The current behaviour of DefaultVisitor is that it will write padding even if it is going to skip writing a value, which results in extraneous padding being added when values are skipped by the tracing-log integration.

Solution

With this change, DefaultVisitor will only insert padding if it is actually going to write a value.