-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON: Field names should account for r#
#3052
Comments
The JSON subscriber uses serde internally so the output should be the same. Are you maybe using |
Yes, using |
I don't think so, you'd need a copy of the fmt subscriber without the valuable feature. But in this case I think this should be fixed in |
So it might not be how the |
Bug Report
Version
0.3.18
Platform
Description
Rust allows us to give struct fields the same name as reserved keywords, such as
type
, if we prefix that name withr#
, as shown here:When serializing this into JSON via
serde
, we see ther#
ignored in the output:However, the JSON support within
tracing-subscriber
does not do this, instead rendering the field name asr#type
.Suggestion: it should account for any field names that start with
r#
and avoid rendering that piece.The text was updated successfully, but these errors were encountered: