Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/github-authentication/src/common/logger.ts
3320 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as vscode from 'vscode';
7
import { AuthProviderType } from '../github';
8
9
export class Log {
10
private output: vscode.LogOutputChannel;
11
12
constructor(private readonly type: AuthProviderType) {
13
const friendlyName = this.type === AuthProviderType.github ? 'GitHub' : 'GitHub Enterprise';
14
this.output = vscode.window.createOutputChannel(`${friendlyName} Authentication`, { log: true });
15
}
16
17
public trace(message: string): void {
18
this.output.trace(message);
19
}
20
21
public debug(message: string): void {
22
this.output.debug(message);
23
}
24
25
public info(message: string): void {
26
this.output.info(message);
27
}
28
29
public error(message: string): void {
30
this.output.error(message);
31
}
32
33
public warn(message: string): void {
34
this.output.warn(message);
35
}
36
}
37
38