From 5527e2b22cd1adf1fb91e42c10c9385e0572eb99 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:02:36 +0200 Subject: [PATCH] also remove deferred log items from open list when finishing them otherwise they end up in the logs twice when exporting --- src/logging/Logger.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/logging/Logger.ts b/src/logging/Logger.ts index 395181ef..37a3326c 100644 --- a/src/logging/Logger.ts +++ b/src/logging/Logger.ts @@ -159,6 +159,11 @@ export class Logger implements ILogger { this._openItems.clear(); } + /** @internal */ + _removeItemFromOpenList(item: LogItem): void { + this._openItems.delete(item); + } + /** @internal */ _persistItem(item: LogItem, filter?: LogFilter, forced?: boolean): void { for (var i = 0; i < this.reporters.length; i += 1) { @@ -186,6 +191,7 @@ class DeferredPersistRootLogItem extends LogItem { finish() { super.finish(); (this._logger as Logger)._persistItem(this, undefined, false); + (this._logger as Logger)._removeItemFromOpenList(this); } forceFinish() {