diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-22 10:15:06 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-22 10:15:06 +0100 |
commit | 2b6c55528d252be180a9b206b9de01c44e67b24f (patch) | |
tree | 03451d6e3698b5623a96807a171f0ba4791033c3 | |
parent | 3f6441e09af842b4a49639cc7562865eace024bc (diff) | |
download | PeerTube-2b6c55528d252be180a9b206b9de01c44e67b24f.tar.gz PeerTube-2b6c55528d252be180a9b206b9de01c44e67b24f.tar.zst PeerTube-2b6c55528d252be180a9b206b9de01c44e67b24f.zip |
Clearer error in parse log
-rwxr-xr-x | scripts/parse-log.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 410da3c61..eb3534e5e 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -75,11 +75,16 @@ function run () { | |||
75 | }) | 75 | }) |
76 | 76 | ||
77 | rl.on('line', line => { | 77 | rl.on('line', line => { |
78 | const log = JSON.parse(line) | 78 | try { |
79 | // Don't know why but loggerFormat does not remove splat key | 79 | const log = JSON.parse(line) |
80 | Object.assign(log, { splat: undefined }) | 80 | // Don't know why but loggerFormat does not remove splat key |
81 | 81 | Object.assign(log, { splat: undefined }) | |
82 | logLevels[log.level](log) | 82 | |
83 | logLevels[log.level](log) | ||
84 | } catch (err) { | ||
85 | console.error('Cannot parse line.', line) | ||
86 | throw err | ||
87 | } | ||
83 | }) | 88 | }) |
84 | 89 | ||
85 | stream.once('close', () => res()) | 90 | stream.once('close', () => res()) |