logging: fix accidental tailing CR LF on certain SerialLoggingReporter messages#1903
Merged
Emantor merged 1 commit intoJun 25, 2026
Conversation
… messages `SerialLoggingReporter._create_message()` appends the representations for `\r\n` to each log message unconditionally. But `\r\n` must only be appended when splitting serial input on `\r\n` in `SerialLoggingReporter.notify()`. Fix that by appending actual `\r\n` to the data to be logged. Do that before its representation is generated. A future commit can then add that data to the `extra` data in the log message allowing reconstruction of the serial data sent/received from the logs. Signed-off-by: Bastian Krause <bst@pengutronix.de>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1903 +/- ##
========================================
- Coverage 45.9% 45.9% -0.1%
========================================
Files 180 180
Lines 14496 14497 +1
========================================
Hits 6666 6666
- Misses 7830 7831 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Emantor
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SerialLoggingReporter._create_message()appends the representations for\r\nto each log message unconditionally. But\r\nmust only be appended when splitting serial input on\r\ninSerialLoggingReporter.notify().Fix that by appending actual
\r\nto the data to be logged. Do that before its representation is generated. A future commit can then add that data to theextradata in the log message allowing reconstruction of the serial data sent/received from the logs.Checklist
Fixes #1155