Clearer error in parse log

pull/3508/head
Chocobozzz 2020-12-22 10:15:06 +01:00
parent 3f6441e09a
commit 2b6c55528d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 9 additions and 4 deletions

View File

@ -75,11 +75,16 @@ function run () {
})
rl.on('line', line => {
const log = JSON.parse(line)
// Don't know why but loggerFormat does not remove splat key
Object.assign(log, { splat: undefined })
try {
const log = JSON.parse(line)
// Don't know why but loggerFormat does not remove splat key
Object.assign(log, { splat: undefined })
logLevels[log.level](log)
logLevels[log.level](log)
} catch (err) {
console.error('Cannot parse line.', line)
throw err
}
})
stream.once('close', () => res())