mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-04 15:25:47 +01:00
verbose to trace
This commit is contained in:
@@ -8,14 +8,14 @@ import { Disposable } from './util/dispose';
|
||||
|
||||
|
||||
export interface ILogger {
|
||||
verbose(message: string, ...args: any[]): void;
|
||||
trace(title: string, message: string, data?: any): void;
|
||||
}
|
||||
|
||||
export class VsCodeOutputLogger extends Disposable implements ILogger {
|
||||
private _outputChannelValue?: vscode.LogOutputChannel;
|
||||
|
||||
private get _outputChannel() {
|
||||
this._outputChannelValue ??= vscode.window.createOutputChannel('TypeScript', { log: true });
|
||||
this._outputChannelValue ??= vscode.window.createOutputChannel('Markdown', { log: true });
|
||||
return this._outputChannelValue;
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@ export class VsCodeOutputLogger extends Disposable implements ILogger {
|
||||
super();
|
||||
}
|
||||
|
||||
public verbose(message: string, ...args: any[]): void {
|
||||
if (this._outputChannel.logLevel === vscode.LogLevel.Trace) {
|
||||
this._outputChannel.trace(message, ...args);
|
||||
}
|
||||
public trace(title: string, message: string, data?: any): void {
|
||||
this._outputChannel.trace(`${title} ${message}`, ...(data ? [JSON.stringify(data, null, 4)] : []));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user