hapijs / good

hapi process monitoring
Other
525 stars 160 forks source link

Add line break after a log message #470

Closed idoshamun closed 8 years ago

idoshamun commented 8 years ago

Currently when a new log message is written to destination (be it stdout, stderr or a file), it doesn't break the line. All logs are being written to the same line.

Version: 7.0.0-rc1

arb commented 8 years ago

One of your streams is going to have to put a new-line in somewhere. I know https://github.com/hapijs/good-squeeze#safejsonoptions-stringify has a separator option for this purpose.

idoshamun commented 8 years ago

What if I want to use good-console, I'm unable to do so if SafeJson attached to the stream? is there any option in good itself to add a line break?

[TypeError: Cannot assign to read only property 'data' of {"event":"log","timestamp":1460961529581,"tags":[],"data":"server running at http://shamun-ubuntu-laptop:3000","pid":19962}

arb commented 8 years ago

Can you show me your stream pipeline that uses good-console? I can only assume you are writing to process.stdout. If that's the case, you'll need a transform stream, either your own or a prebuilt one from npm, that appends "\n" to data in the _transform method of your stream.

idoshamun commented 8 years ago

That's exactly what I did. I created a new class which appends \r\n. Thinking about publishing it for other developers

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.