From 942fded9d620f18d88345840193281f38308758d Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sat, 25 Aug 2018 12:22:10 -0600 Subject: [PATCH] Fixed prettyPrint to pass through non-json lines --- server/logging/prettyPrint.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/logging/prettyPrint.ts b/server/logging/prettyPrint.ts index 2775a2d..d2d0f17 100644 --- a/server/logging/prettyPrint.ts +++ b/server/logging/prettyPrint.ts @@ -122,7 +122,13 @@ function asColoredLevel(value: any) { } const prettyTransport = through.obj((chunk, enc, cb) => { - const value = JSON.parse(chunk.toString()); + let value: any; + try { + value = JSON.parse(chunk.toString()); + } catch (e) { + process.stdout.write(chunk.toString() + "\n"); + return cb(); + } const line = formatter(value); if (!line) { return cb();