mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Clearer error in parse log
This commit is contained in:
parent
3f6441e09a
commit
2b6c55528d
1 changed files with 9 additions and 4 deletions
|
@ -75,11 +75,16 @@ function run () {
|
||||||
})
|
})
|
||||||
|
|
||||||
rl.on('line', line => {
|
rl.on('line', line => {
|
||||||
|
try {
|
||||||
const log = JSON.parse(line)
|
const log = JSON.parse(line)
|
||||||
// Don't know why but loggerFormat does not remove splat key
|
// Don't know why but loggerFormat does not remove splat key
|
||||||
Object.assign(log, { splat: undefined })
|
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())
|
stream.once('close', () => res())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue