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
tracing-journald: Write literal string values to journal #1714
Conversation
@Ralith Would you mind to take a look? I'm not entirely happy with this code, but I'm not sure how to make it better, short of a refactoring of all these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from one cosmetic issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me, beyond the outdated comment that @Ralith commented on; I think we should probably just remove that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@hawkw I've rebased onto master and address all remaining change requests; would you mind to take another look? 😊 |
See #1710: Do not write strings in Debug representation. ## Motivation As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings. Fixes #1710.
See #1710: Do not write strings in Debug representation. ## Motivation As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings. Fixes #1710.
See #1710: Do not write strings in Debug representation. ## Motivation As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings. Fixes #1710.
See #1710: Do not write strings in Debug representation. ## Motivation As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings. Fixes #1710.
See #1710: Do not write strings in Debug representation. ## Motivation As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings. Fixes #1710.
# 0.2.1 (December 29, 2021) This release improves how `tracing-journald` communicates with `journald`, including the handling of large payloads. ### Added - Use an unconnected socket, so that logging can resume after a `journald` restart ([#1758]) ### Fixed - Fixed string values being written using `fmt::Debug` ([#1714]) - Fixed `EMSGSIZE` when log entries exceed a certain size ([#1744]) A huge thank-you to new contributor @lunaryorn, for contributing all of the changes in this release! [#1714]: #1714 [#1744]: #1744 [#1758]: #1758
# 0.2.1 (December 29, 2021) This release improves how `tracing-journald` communicates with `journald`, including the handling of large payloads. ### Added - Use an unconnected socket, so that logging can resume after a `journald` restart ([#1758]) ### Fixed - Fixed string values being written using `fmt::Debug` ([#1714]) - Fixed `EMSGSIZE` when log entries exceed a certain size ([#1744]) A huge thank-you to new contributor @lunaryorn, for contributing all of the changes in this release! [#1714]: #1714 [#1744]: #1744 [#1758]: #1758
/// `value` must not contain an internal newline. | ||
/// | ||
/// For a "newline-safe" variant, see `put_field_length_encoded`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisiting these comments, is this correct? We're using length-prefixing, so per https://systemd.io/JOURNAL_NATIVE_PROTOCOL/ internal newlines in the value are fine. put_field_length_encoded
uses exactly the same encoding, it just doesn't require the length to be known in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps not. It really looks as if both function are the same…but I only took a superficial look 🤔
See #1710: Do not write strings in Debug representation.
Motivation
As discussed in #1710 writing strings literally makes tracing-journald behave like other journal clients, and allows 3rd party journal readers to extract the original value from the journal without having to "un"-parse the Debug representation of Rust strings.