Open tomgco opened 10 years ago
We had some discussion around this in #134
+1 let's do it
You might also consider using an event emitter to facilitate logging. The following slide-deck has a pretty good example of this in action: http://michaelbrooks.ca/deck/2013-node-brigade/#/62.
BTW, since switching to this pattern in a large app, life has been all kinds of better. We have lots of sub-apps that should comply with the overall logging strategy which is configurable from the app and from the developer's perspective. Emitting async events helps a lot.
I suspect this pattern would be useful for plugin development as well.
Thanks for the link! @niallo what do you think of that? Just post messages to the global eventemitter?
On Fri, Jan 24, 2014 at 10:46 PM, Wil Moore III notifications@github.comwrote:
You might also consider using an event emitter to facilitate logging. The following slide-deck has a pretty good example of this in action: http://michaelbrooks.ca/deck/2013-node-brigade/#/62
— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/301#issuecomment-33281896 .
Instead of littering the sourcecode with console.{logs, errors} which are Syncronous I propose moving to use a JSON logger like bunyan.
One which I have used in production is bunyan: https://github.com/trentm/node-bunyan
“Bunyan is a simple and fast JSON logging library for node.js services”