actually track log items, and correctly remove them

This commit is contained in:
Bruno Windels 2021-02-12 18:36:04 +01:00
parent a53c25d2ae
commit 42780df94f

View File

@ -27,13 +27,14 @@ export class BaseLogger {
wrapLog(labelOrValues, callback, logLevel = this._baseLogLevel) { wrapLog(labelOrValues, callback, logLevel = this._baseLogLevel) {
const item = new LogItem(labelOrValues, logLevel, this._platform, this._anonymize); const item = new LogItem(labelOrValues, logLevel, this._platform, this._anonymize);
this._openItems.add(item);
const finishItem = () => { const finishItem = () => {
const serialized = item.serialize(this._baseLogLevel); const serialized = item.serialize(this._baseLogLevel);
if (serialized) { if (serialized) {
this._persistItem(serialized); this._persistItem(serialized);
} }
this._openItems.remove(item); this._openItems.delete(item);
}; };
try { try {