rename level => levelname to avoid type clashing in ES

This commit is contained in:
Daniel García Aubert 2020-06-11 12:30:15 +02:00
parent f6c8796c8a
commit bf250e592a

View File

@ -44,7 +44,9 @@ module.exports = function logCollector () {
if (end === true) { if (end === true) {
const accEntry = logs.get(id); const accEntry = logs.get(id);
accEntry.level = LEVELS[accEntry.level]; // rename level => levelname to avoid type clashing in ES
accEntry.levelname = LEVELS[accEntry.level];
delete accEntry.level;
accEntry.time = entry.time; accEntry.time = entry.time;
this.push(`${JSON.stringify(accEntry)}\n`); this.push(`${JSON.stringify(accEntry)}\n`);
logs.delete(id); logs.delete(id);