Skip to content

Commit 509bf5a

Browse files
committed
(maint) Expose Outputchannel in OutputChannelLogger
This commit adds a new readonly property to the `OutputChannelLogger` class so it can be used by the LanguageServerClient.
1 parent fa058a7 commit 509bf5a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/logging/outputchannel.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import * as logging from '../logging';
55
import { ISettings } from '../settings';
66

77
export class OutputChannelLogger implements logging.ILogger {
8-
private logChannel: vscode.OutputChannel;
8+
9+
private _logChannel : vscode.OutputChannel;
10+
public get logChannel() : vscode.OutputChannel {
11+
return this._logChannel;
12+
}
913

1014
// Minimum log level that is shown to users on logChannel
1115
private minimumUserLogLevel: logging.LogLevel;
1216

1317
constructor(settings: ISettings) {
14-
this.logChannel = vscode.window.createOutputChannel('Puppet');
18+
this._logChannel = vscode.window.createOutputChannel('Puppet');
1519

1620
let logLevel = settings.editorService.loglevel;
1721

@@ -23,7 +27,7 @@ export class OutputChannelLogger implements logging.ILogger {
2327
}
2428

2529
public show() {
26-
this.logChannel.show();
30+
this._logChannel.show();
2731
}
2832

2933
public verbose(message: string) {
@@ -50,7 +54,7 @@ export class OutputChannelLogger implements logging.ILogger {
5054
let logMessage = this.logLevelPrefixAsString(level) + new Date().toISOString() + ' ' + message;
5155

5256
if (level >= this.minimumUserLogLevel) {
53-
this.logChannel.appendLine(logMessage);
57+
this._logChannel.appendLine(logMessage);
5458
}
5559
}
5660

0 commit comments

Comments
 (0)