Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-polling-watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaaaash authored Jan 13, 2025
2 parents 907746f + b367234 commit c7f4640
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/output/src/browser/output.channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,18 @@ export class OutputChannel extends Disposable {

appendLine(line: string): void {
let value = line;
if (!line.endsWith('\r\n')) {
value = line + '\r\n';
if (typeof line !== 'string') {
try {
value = JSON.stringify(line);
} catch (e) {
value = `[${typeof line}]`;
}
}

if (!value.endsWith('\r\n')) {
value = value + '\r\n';
}

this.eventBus.fire(
new ContentChangeEvent(
new ContentChangeEventPayload(this.name, ContentChangeType.appendLine, value, this.outputLines),
Expand All @@ -169,7 +178,7 @@ export class OutputChannel extends Disposable {
if (this.shouldLogToBrowser) {
// eslint-disable-next-line no-console
console.log(
`%c[${this.name}]` + `%c ${line}}`,
`%c[${this.name}]` + `%c ${value}}`,
'background:rgb(50, 150, 250); color: #fff',
'background: none; color: inherit',
);
Expand Down

0 comments on commit c7f4640

Please sign in to comment.