Added enableObjectStream option#194
Conversation
|
@dougwilson Could you please have a look 😄 Thanks ! |
|
I will after the express 4.17 release is out, as there was a premature vulnerability listed and it is our number 1 priority right now, I hope you understand. |
|
@dougwilson I did some digging and I've realised that a lot of people tried to make this change to Morgan but it never went out. Morgan is being used by numerous of our project and does the job, other than the fact that it emits a string that we have to parse. It would be great if we can work something out, otherwise, we might have to implement our own middleware Thanks again and looking forward to your review & opinion |
|
Any updates? Thanks! |
dougwilson
left a comment
There was a problem hiding this comment.
Sorry, still getting reports about 4.17 from users. Here is a very quick review for points to work on:
- No docs for new feature in pr
- Does not work right when buffer feature enabled
- Silently does nothing when using built in formatters. It could throw an error or at least be documented.
I hope this feedback helps while I am working on 4.17 issues in parallel.
Background
I've got a similar use case with the issue raised: #181.
I am using Morgan for a lot of my projects and I would like to be able to write an Object in a stream instead of just a string.
Reason is that I am using Winston which supports meta-data for reach-er logs. I would like to use morgan and pass an object to Winston - instead of parsing a string.
Changes
enableObjectStreamin morgan() call.customFormatFunction && stream && enableObjectStream), we are not concatenating a\n(newline char), hence morgan can stream an object.Any improvements/changes are welcome.
TODO:
but I'd like to get some opinions first 😄