Skip to content

Stamp output captured from a package's own process - #20

Merged
rodchristiansen merged 1 commit into
mainfrom
feature/stamp-captured-output
Sep 3, 2026
Merged

Stamp output captured from a package's own process#20
rodchristiansen merged 1 commit into
mainfrom
feature/stamp-captured-output

Conversation

@rodchristiansen

Copy link
Copy Markdown
Contributor

A package's stdout was copied into the session log as a single message, so only its first line carried a timestamp and level and every line after it landed as bare text between two properly formatted lines. Now that the log viewer renders stamped lines as event rows, that raw block is the only thing in the file that is not one.

Two changes:

  • WriteToFile emits one stamped line per line and drops blank ones. This is the actual defect — any multi-line message had the same problem, not just captured output, so fixing it at the writer means it cannot recur somewhere else.
  • Captured output goes through a new WriteCapturedOutput, which tags each line [OUTPUT] <package>: and sends stderr at WARN, so a reader can tell the package's words from BootstrapMate's own. The tag is uppercase in brackets at the start of the message, matching the existing [PROGRESS], [SUCCESS] and [SECTION] tags the viewer renders as pills.

ANSI sequences are stripped — a package writes for a terminal and nothing renders an escape code in a log file.

Verified against the reported case. Feeding the multi-line block from the run that prompted this produces:

[2026-09-02 22:51:00] INFO  [OUTPUT] Preflight System Prep: Starting Chocolatey obliteration process...
[2026-09-02 22:51:00] INFO  [OUTPUT] Preflight System Prep: Removing Chocolatey package manager...
[2026-09-02 22:51:00] INFO  [OUTPUT] Preflight System Prep: Chocolatey removal completed successfully
[2026-09-02 22:51:00] INFO  [OUTPUT] Preflight System Prep: System is now ready for BootstrapMate deployment.

with the blank line dropped. A full run of the built binary produces 18 log lines, 0 unstamped.

A package's stdout was copied into the session log as one message, so only its
first line carried a timestamp and level and the rest landed as bare text
between two properly formatted lines. The log viewer renders stamped lines as
event rows, which made the raw block stand out as the only thing in the file
that was not one.

WriteToFile now emits one stamped line per line and drops blank ones, so no
multi-line message can produce bare text again. Captured output additionally
goes through WriteCapturedOutput, which tags each line [OUTPUT] <package>: and
sends stderr at WARN, so a reader can tell the package's words from
BootstrapMate's own. ANSI sequences are stripped: a package writes for a
terminal, and nothing renders an escape code in a log file.
@rodchristiansen
rodchristiansen merged commit e9c0498 into main Sep 3, 2026
2 checks passed
@rodchristiansen
rodchristiansen deleted the feature/stamp-captured-output branch September 3, 2026 06:05
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.

1 participant