Path: blob/main/extensions/github-authentication/src/common/logger.ts
3320 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as vscode from 'vscode';6import { AuthProviderType } from '../github';78export class Log {9private output: vscode.LogOutputChannel;1011constructor(private readonly type: AuthProviderType) {12const friendlyName = this.type === AuthProviderType.github ? 'GitHub' : 'GitHub Enterprise';13this.output = vscode.window.createOutputChannel(`${friendlyName} Authentication`, { log: true });14}1516public trace(message: string): void {17this.output.trace(message);18}1920public debug(message: string): void {21this.output.debug(message);22}2324public info(message: string): void {25this.output.info(message);26}2728public error(message: string): void {29this.output.error(message);30}3132public warn(message: string): void {33this.output.warn(message);34}35}363738