Make logger API proposed, add jsdoc, and match some extension API conventions better

This commit is contained in:
Rob Lourens
2017-12-13 14:02:27 -08:00
parent b3fde70cb4
commit d279e2de6c
3 changed files with 42 additions and 31 deletions

View File

@@ -40,19 +40,22 @@ export class ExtHostLogService implements ExtHostLogServiceShape {
}
}
export class ExtHostLogger implements vscode.ILogger {
export class ExtHostLogger implements vscode.Logger {
private _currentLevel: LogLevel;
get onDidChangeLogLevel(): Event<LogLevel> { return this._extHostLogService.onDidChangeLogLevel; }
constructor(
private readonly _extHostLogService: ExtHostLogService,
private readonly _logService: ILogService,
private readonly _logDirectory: string
) {
this._currentLevel = this._logService.getLevel();
this._extHostLogService.onDidChangeLogLevel(logLevel => this._currentLevel = logLevel);
}
get onDidChangeLogLevel(): Event<LogLevel> { return this._extHostLogService.onDidChangeLogLevel; }
get currentLevel(): LogLevel { return this._currentLevel; }
getLogDirectory(): TPromise<string> {
return dirExists(this._logDirectory).then(exists => {
if (exists) {