Do not rename level and error fields

This commit is contained in:
Daniel García Aubert 2020-06-11 18:15:44 +02:00
parent 2444b4c008
commit 49735308de

View File

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