diff --git a/extensions/typescript/src/utils/logger.ts b/extensions/typescript/src/utils/logger.ts index 53f09faa4f6e538b3a40e57b05c70551fb937e06..cc57346efbf5ca1a67d9640b5307810a63918d78 100644 --- a/extensions/typescript/src/utils/logger.ts +++ b/extensions/typescript/src/utils/logger.ts @@ -5,18 +5,16 @@ import { OutputChannel, window } from 'vscode'; import * as is from './is'; +import { memoize } from './memoize'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); export default class Logger { - private _output?: OutputChannel; + @memoize private get output(): OutputChannel { - if (!this._output) { - this._output = window.createOutputChannel(localize('channelName', 'TypeScript')); - } - return this._output; + return window.createOutputChannel(localize('channelName', 'TypeScript')); } private data2String(data: any): string {