Stamp output captured from a package's own process - #20
Merged
Conversation
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.
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.
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:
WriteToFileemits 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.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:
with the blank line dropped. A full run of the built binary produces 18 log lines, 0 unstamped.