Skip to content

logging: fix accidental tailing CR LF on certain SerialLoggingReporter messages#1903

Merged
Emantor merged 1 commit into
labgrid-project:masterfrom
Bastian-Krause:bst/logging-fix-additional-crlf
Jun 25, 2026
Merged

logging: fix accidental tailing CR LF on certain SerialLoggingReporter messages#1903
Emantor merged 1 commit into
labgrid-project:masterfrom
Bastian-Krause:bst/logging-fix-additional-crlf

Conversation

@Bastian-Krause

Copy link
Copy Markdown
Member

Description
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.

Checklist

  • PR has been tested

Fixes #1155

… 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>
@Bastian-Krause Bastian-Krause added fix pick to stable Needs a pick to the latest stable branch labels Jun 24, 2026
@Bastian-Krause Bastian-Krause changed the title logging: fix accidental tailing \r\n on certain SerialLoggingReporter messages logging: fix accidental tailing CR LF on certain SerialLoggingReporter messages Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.9%. Comparing base (be8f3a2) to head (49834c1).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/logging.py 0.0% 2 Missing ⚠️
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     
Flag Coverage Δ
3.10 45.9% <0.0%> (-0.1%) ⬇️
3.11 45.9% <0.0%> (-0.1%) ⬇️
3.12 45.9% <0.0%> (-0.1%) ⬇️
3.13 45.9% <0.0%> (-0.1%) ⬇️
3.14 45.9% <0.0%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Emantor
Emantor merged commit 325415a into labgrid-project:master Jun 25, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pick to stable Needs a pick to the latest stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants