mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
* introduce log api in extension context * separate registering output vs log channel * Separate extension log channels in show logs command * add logging error to embedder logger * show extension log in the extension editor * configure log level per extension * change the order of log entries * introduce logger * align with output chanel * revert changes * fixes
30 lines
970 B
TypeScript
30 lines
970 B
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 { AuthProviderType } from '../github';
|
|
|
|
export class Log {
|
|
private output: vscode.LogOutputChannel;
|
|
|
|
constructor(private readonly type: AuthProviderType) {
|
|
const friendlyName = this.type === AuthProviderType.github ? 'GitHub' : 'GitHub Enterprise';
|
|
this.output = vscode.window.createOutputChannel(`${friendlyName} Authentication`, { log: true });
|
|
}
|
|
|
|
public trace(message: string): void {
|
|
this.output.trace(message);
|
|
}
|
|
|
|
public info(message: string): void {
|
|
this.output.info(message);
|
|
}
|
|
|
|
public error(message: string): void {
|
|
this.output.error(message);
|
|
}
|
|
|
|
}
|