Fixed prettyPrint to pass through non-json lines
This commit is contained in:
parent
ed8d012a4b
commit
942fded9d6
@ -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…
x
Reference in New Issue
Block a user