Browse Source

Fixed prettyPrint to pass through non-json lines

update-deps
Alex Mikhalev 6 years ago
parent
commit
942fded9d6
  1. 8
      server/logging/prettyPrint.ts

8
server/logging/prettyPrint.ts

@ -122,7 +122,13 @@ function asColoredLevel(value: any) { @@ -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();

Loading…
Cancel
Save