added prefix for log output (#126)
This commit is contained in:
Родитель
4f9b0fbc1f
Коммит
850e69d9ad
|
@ -1,4 +1,4 @@
|
|||
import {ILogger, LogHelper, LogLevel} from "./logHelper";
|
||||
import {ILogger, LogHelper, LogLevel, AppCenterExtensionLogPrefix} from "./logHelper";
|
||||
|
||||
export class ConsoleLogger implements ILogger {
|
||||
public log(message: string, level: LogLevel): void {
|
||||
|
@ -38,6 +38,6 @@ export class ConsoleLogger implements ILogger {
|
|||
}
|
||||
|
||||
protected static getFormattedMessage(message: string, level: LogLevel): string {
|
||||
return `[${LogLevel[level]}] ${message}\n`;
|
||||
return `[${AppCenterExtensionLogPrefix}: ${LogLevel[level]}] ${message}\n`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ export class LogHelper {
|
|||
}
|
||||
}
|
||||
|
||||
export const AppCenterExtensionLogPrefix: string = "VSCode App Center";
|
||||
|
||||
function getLogLevel() {
|
||||
try {
|
||||
const SettingsHelper = require("../settingsHelper").SettingsHelper;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as vscode from "vscode";
|
||||
import { ILogger, LogHelper, LogLevel } from "./logHelper";
|
||||
import { ILogger, LogHelper, LogLevel, AppCenterExtensionLogPrefix } from "./logHelper";
|
||||
|
||||
const channels: { [channelName: string]: OutputChannelLogger } = {};
|
||||
|
||||
|
@ -74,7 +74,7 @@ export class OutputChannelLogger implements ILogger {
|
|||
}
|
||||
|
||||
protected static getFormattedMessage(message: string, level: LogLevel): string {
|
||||
return `[${LogLevel[level]}] ${message}\n`;
|
||||
return `[${AppCenterExtensionLogPrefix}: ${LogLevel[level]}] ${message}\n`;
|
||||
}
|
||||
|
||||
public getOutputChannel(): vscode.OutputChannel {
|
||||
|
|
|
@ -7,7 +7,7 @@ export class LogStrings {
|
|||
public static FailedToGetVSTSProjectList: string = "Failed to get VSTS Project list.";
|
||||
public static FailedToGetVSTSReposList: string = "Failed to get VSTS Git repositories list.";
|
||||
public static FailedToGetAppCenterProfile: string = "Could get profile from App Center.";
|
||||
public static FailedToGetProfileFile: string = "No profile file found.";
|
||||
public static FailedToGetProfileFile: string = "Profile not found. Login to the App Center via the Visual Studio Code Extension to create the profile.";
|
||||
public static FailedToGetUserProfile: string = "Couldn't get user profile.";
|
||||
public static FailedToGetUserFromServer: string = "Failed to fetch user info from server";
|
||||
public static NoTokenProvided: string = "No token provided on login";
|
||||
|
|
Загрузка…
Ссылка в новой задаче