mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-08 19:10:39 +01:00
* Enforce stable link presentation provider kinds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 * Fix link presentation CI failures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 * Register GitHub contribution for localization Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 * Remove Markdown GitHub link presentations Keep GitHub repository, issue, and pull request presentations in core only. Address review feedback around provider re-registration, cache kind validation, check statuses, fixture kinds, and optional repository fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 * Fix default account event test type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 * Fix default account type import Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8d0d714f-06c2-4399-83ba-5016fae514f5
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
import { Disposable } from './util/dispose';
|
|
|
|
|
|
export interface ILogger {
|
|
trace(title: string, message: string, data?: unknown): void;
|
|
}
|
|
|
|
export class VsCodeOutputLogger extends Disposable implements ILogger {
|
|
#outputChannelValue?: vscode.LogOutputChannel;
|
|
|
|
get #outputChannel() {
|
|
this.#outputChannelValue ??= this._register(vscode.window.createOutputChannel('Markdown', { log: true }));
|
|
return this.#outputChannelValue;
|
|
}
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
public trace(title: string, message: string, data?: unknown): void {
|
|
if (!this.#outputChannelValue && vscode.env.logLevel !== vscode.LogLevel.Trace) {
|
|
return;
|
|
}
|
|
const outputChannel = this.#outputChannel;
|
|
if (outputChannel.logLevel === vscode.LogLevel.Trace) {
|
|
outputChannel.trace(`${title}: ${message}`, ...(data ? [JSON.stringify(data, null, 4)] : []));
|
|
}
|
|
}
|
|
}
|