Skip to content

Commit 4761744

Browse files
committed
Allow logging without newlines to make life easier for log collectors.
Issue mendhak#11
1 parent 2f47526 commit 4761744

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ app.all('*', (req, res) => {
5959
res.json(echo);
6060
if (process.env.LOG_IGNORE_PATH != req.path) {
6161
console.log('-----------------')
62-
console.log(JSON.stringify(echo, null, 4));
62+
63+
let spacer = 4;
64+
if(process.env.LOG_WITHOUT_NEWLINE){
65+
spacer = null;
66+
}
67+
68+
console.log(JSON.stringify(echo, null, spacer));
6369
}
6470
});
6571

0 commit comments

Comments
 (0)