Skip to content

Commit

Permalink
Fix log message parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Discookie committed May 2, 2024
1 parent a66a70b commit fcd2fb7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/backend/executor/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ export class ScheduledProcess implements Disposable {
this.processParameters.forwardStdoutToLogs = !forwardDefaults.includes(processType);
}

const parseLogMessage = (line: string) => {
// Do not store json output as last error
if (line.startsWith('{') || line === '') {
return;
}
const parseLogMessage = (stdout: string) => {
// Do not store json output or meta messages as last error
const lines = stdout.split('\n')
.filter((line) => !line.startsWith('{') && !line.startsWith('>') && line !== '');

this.lastLogMessage = line;
if (lines.length > 0) {
this.lastLogMessage = lines[lines.length - 1];
}
};

this.processStdout(parseLogMessage, this);
Expand Down

0 comments on commit fcd2fb7

Please sign in to comment.