Skip to content

Commit

Permalink
Fix debugger client's logging message trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Dec 18, 2024
1 parent f4b6baa commit a407d77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vscode/src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,12 @@ export class Debugger
}

private logDebuggerMessage(message: string) {
const trimmedMessage = message.trimEnd();
if (trimmedMessage.length > 0) {
LOG_CHANNEL.info(`[debugger]: ${trimmedMessage}`);
this.console.append(trimmedMessage);
}
// In the Output panel, each log automatically gets a new line
// And trailing newlines will create one additional line in the panel, so we trimEnd() here to avoid that
LOG_CHANNEL.info(`[debugger]: ${message.trimEnd()}`);

// In the Debug Console, output doesn't get a new line automatically, so we don't trimEnd() here as well as print
// the newlines too
this.console.append(message);
}
}

0 comments on commit a407d77

Please sign in to comment.