Skip to content

Repeat log prefix on each line of multi-line output#893

Merged
LasmarKhalifa merged 2 commits into
mainfrom
05-19/repeat-log-prefix-on-each-line
May 28, 2026
Merged

Repeat log prefix on each line of multi-line output#893
LasmarKhalifa merged 2 commits into
mainfrom
05-19/repeat-log-prefix-on-each-line

Conversation

@LasmarKhalifa
Copy link
Copy Markdown
Contributor

@LasmarKhalifa LasmarKhalifa commented May 21, 2026

fixes #876

The goal of this PR is to clean up the output of workflow runs by making it easier to read and understand which lines are part of which action.

Examples

Old terminal output New terminal output:
image.png image.png

Old log output New log output
image.png image.png

Note: went with dots on continuation lines instead of whitespace so the "missing" prefix reads as intentional rather than looking like a rendering glitch or a dropped line. It also avoids touching msg2str, which strips leading/trailing whitespace. Any future .strip added elsewhere in the pipeline could also silently collapse a whitespace prefix.

Copy link
Copy Markdown
Contributor Author

LasmarKhalifa commented May 21, 2026

@LasmarKhalifa LasmarKhalifa changed the title Make the log prefix repeat on every line Repeat log prefix on each line of multi-line output May 21, 2026
@LasmarKhalifa LasmarKhalifa force-pushed the 05-19/repeat-log-prefix-on-each-line branch from 1525c26 to 2b8d31c Compare May 21, 2026 21:01
@LasmarKhalifa LasmarKhalifa marked this pull request as ready for review May 21, 2026 21:31
@juniper-shopify
Copy link
Copy Markdown
Contributor

Note: went with dots on continuation lines instead of whitespace so the "missing" prefix reads as intentional rather than looking like a rendering glitch or a dropped line. It also avoids touching msg2str, which strips leading/trailing whitespace. Any future .strip added elsewhere in the pipeline could also silently collapse a whitespace prefix.

I like that idea. The dots do look intentional, and it is more robust to potential whitespace stripping :)

Comment thread lib/roast/log_formatter.rb
Comment thread test/roast/event_monitor_test.rb Outdated
Comment thread test/roast/event_monitor_test.rb Outdated
Comment thread test/roast/event_monitor_test.rb
Comment thread test/roast/log_formatter_test.rb
Comment thread test/roast/log_formatter_test.rb
@LasmarKhalifa LasmarKhalifa force-pushed the 05-19/repeat-log-prefix-on-each-line branch from 2b8d31c to 6950523 Compare May 26, 2026 21:11
Copy link
Copy Markdown
Contributor

@juniper-shopify juniper-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this as it is, as long as we follow up with a better version of stdout/stderr detection for the colourizer, like you're already working on in #903

Comment thread lib/roast/log_formatter.rb
Copy link
Copy Markdown
Contributor Author

LasmarKhalifa commented May 28, 2026

Merge activity

  • May 28, 7:49 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 28, 7:49 PM UTC: @LasmarKhalifa merged this pull request with Graphite.

@LasmarKhalifa LasmarKhalifa merged commit 79fd669 into main May 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeat log prefix on each line of multi-line output

2 participants