From a69c83f64f6b9f385b26ff0d500d6832bf879277 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 7 May 2017 02:00:04 -0400 Subject: [PATCH] Adds ExtensionOutputChannelName to constants --- src/constants.ts | 1 + src/logger.ts | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 4f69aa4..f192f92 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -2,6 +2,7 @@ export const ExtensionId = 'gitlens'; export const ExtensionKey = ExtensionId; +export const ExtensionOutputChannelName = 'GitLens'; export const QualifiedExtensionId = `eamodio.${ExtensionId}`; export const ApplicationInsightsKey = 'a9c302f8-6483-4d01-b92c-c159c799c679'; diff --git a/src/logger.ts b/src/logger.ts index dce1730..43b97d6 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,11 +1,10 @@ 'use strict'; import { ExtensionContext, OutputChannel, window, workspace } from 'vscode'; import { IConfig } from './configuration'; -import { ExtensionKey } from './constants'; +import { ExtensionKey, ExtensionOutputChannelName } from './constants'; import { Telemetry } from './telemetry'; -const OutputChannelName = 'GitLens'; -const ConsolePrefix = `[${OutputChannelName}]`; +const ConsolePrefix = `[${ExtensionOutputChannelName}]`; export type OutputLevel = 'silent' | 'errors' | 'verbose'; export const OutputLevel = { @@ -29,7 +28,7 @@ function onConfigurationChanged() { output && output.dispose(); } else { - output = output || window.createOutputChannel(OutputChannelName); + output = output || window.createOutputChannel(ExtensionOutputChannelName); } } } @@ -43,7 +42,7 @@ export class Logger { static log(message?: any, ...params: any[]): void { if (debug && level !== OutputLevel.Silent) { - console.log(ConsolePrefix, message, ...params, '\n'); + console.log(ConsolePrefix, message, ...params); } if (level === OutputLevel.Verbose) { @@ -53,7 +52,7 @@ export class Logger { static error(ex: Error, classOrMethod?: string, ...params: any[]): void { if (debug) { - console.error(ConsolePrefix, classOrMethod, ex, ...params, '\n'); + console.error(ConsolePrefix, classOrMethod, ex, ...params); } if (level !== OutputLevel.Silent) { @@ -65,7 +64,7 @@ export class Logger { static warn(message?: any, ...params: any[]): void { if (debug) { - console.warn(ConsolePrefix, message, ...params, '\n'); + console.warn(ConsolePrefix, message, ...params); } if (level !== OutputLevel.Silent) {