Skip to content

Commit

Permalink
debt - print errors in main properly (#84283)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jan 6, 2020
1 parent e20e2f3 commit 541474a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/vs/platform/log/common/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { LoggerChannelClient } from 'vs/platform/log/common/logIpc';
import { URI } from 'vs/base/common/uri';
import { toErrorMessage } from 'vs/base/common/errorMessage';

export const ILogService = createServiceDecorator<ILogService>('logService');
export const ILoggerService = createServiceDecorator<ILoggerService>('loggerService');
Expand Down Expand Up @@ -245,15 +246,15 @@ export class ConsoleLogInMainService extends AbstractLogService implements ILogS
}
}

error(message: string, ...args: any[]): void {
error(message: string | Error, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Error) {
this.client.consoleLog('error', [message, ...args]);
this.client.consoleLog('error', [toErrorMessage(message, this.getLevel() <= LogLevel.Trace), ...args]);
}
}

critical(message: string, ...args: any[]): void {
critical(message: string | Error, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Critical) {
this.client.consoleLog('critical', [message, ...args]);
this.client.consoleLog('critical', [toErrorMessage(message, this.getLevel() <= LogLevel.Trace), ...args]);
}
}

Expand Down

0 comments on commit 541474a

Please sign in to comment.