fix(logging): combine newline-split stdout messages into one log entry#9757
Open
rishika0212 wants to merge 3 commits intoflutter:masterfrom
Open
fix(logging): combine newline-split stdout messages into one log entry#9757rishika0212 wants to merge 3 commits intoflutter:masterfrom
rishika0212 wants to merge 3 commits intoflutter:masterfrom
Conversation
srawlins
requested changes
Apr 3, 2026
Contributor
srawlins
left a comment
There was a problem hiding this comment.
Just a preliminary review so we can kick off CI.
packages/devtools_app/lib/src/screens/logging/logging_controller.dart
Outdated
Show resolved
Hide resolved
srawlins
requested changes
Apr 4, 2026
packages/devtools_app/lib/src/screens/logging/logging_controller.dart
Outdated
Show resolved
Hide resolved
elliette
requested changes
Apr 7, 2026
Member
elliette
left a comment
There was a problem hiding this comment.
Hi @rishika0212 - do you mind adding before/after screenshots to the PR description for this change? Thank you!
Contributor
Author
Before (master): a single multiline log message using \n appears as two separate log entries (FIRST LINE and SECOND LINE).
After (this PR): the same multiline message appears as one log entry, with both lines shown together in Details.
|
elliette
requested changes
Apr 8, 2026
packages/devtools_app/integration_test/test/live_connection/debugger_panel_test.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/integration_test/test/live_connection/network_screen_test.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app_shared/lib/src/service/eval_on_dart_library.dart
Outdated
Show resolved
Hide resolved
packages/devtools_shared/lib/src/test/integration_test_runner.dart
Outdated
Show resolved
Hide resolved
0383010 to
4a5b354
Compare
srawlins
approved these changes
Apr 13, 2026
Contributor
|
LGTM, @elliette |
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.


Fixes #9557
When
debugPrint('line1\nline2')is called, the VM sends the message as two separate stdout events:'line1\n'and'line2'. The existing 1ms buffer inStdoutEventHandleronly handled the case where the second event is a lone'\n'(e.g.foofollowed by\n). It did not handle embedded newlines, so each chunk became a separate log entryin the Logging screen.
The fix extends the buffer logic: if the buffered message ends with
'\n', the next incoming message is treated as a continuation of the same print statement and combined into a single log entry._StdoutEventHandlerwas also exposed asStdoutEventHandlerwith@visibleForTestingto allow direct unit testing of the handler logic.Before:
debugPrint('line1\nline2')appeared as two separate log entries.After: It appears as a single log entry.
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcome] or [good-first-issue] label.contributions-welcome] or [good-first-issue] label. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.