From bf250e592a1a3a22847014b61b422e559ae08b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 11 Jun 2020 12:30:15 +0200 Subject: [PATCH] rename level => levelname to avoid type clashing in ES --- metro/log-collector.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metro/log-collector.js b/metro/log-collector.js index bbb3c7b5..4eda405d 100644 --- a/metro/log-collector.js +++ b/metro/log-collector.js @@ -44,7 +44,9 @@ module.exports = function logCollector () { if (end === true) { 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; this.push(`${JSON.stringify(accEntry)}\n`); logs.delete(id);