From 09e732f78e4232d3d87854db85cacb8bdf619f54 Mon Sep 17 00:00:00 2001 From: Erki Aas Date: Wed, 9 Nov 2022 12:02:39 +0200 Subject: [PATCH] Use log.level if exists, translate stream to level, display level as col --- src/components/Grid/Main/config.js | 2 +- src/helpers/parseEventData.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Grid/Main/config.js b/src/components/Grid/Main/config.js index 9f2101e..c0b1bf4 100644 --- a/src/components/Grid/Main/config.js +++ b/src/components/Grid/Main/config.js @@ -52,7 +52,7 @@ const config = { width: 500, }, { - field: 'stream', + field: 'level', }, ], } diff --git a/src/helpers/parseEventData.js b/src/helpers/parseEventData.js index 0fa1b9d..0b802f3 100644 --- a/src/helpers/parseEventData.js +++ b/src/helpers/parseEventData.js @@ -12,6 +12,15 @@ const parseEventData = (eventData) => { if (message) { json.message = message } + let level; + if (json.log && json.log.level) { + level = json.log.level + } else if (json.stream) { + level = json.stream === 'stderr' ? 'error' : 'info' + } + if (level) { + json.level = level + } return json } catch (e) { console.error(e, eventData)