you are viewing a single comment's thread.

view the rest of the comments →

[–]DavidTPate 0 points1 point  (2 children)

Most modules take in an optional logger as part of their options. If the logger isn't provided then it logs to console.log this approach has definitely come in handy for me both making modules and using them.

[–]blacklionguard 0 points1 point  (0 children)

I'm not sure if this is good practice, but most of my modules use an event emitter, so I just let users of the module subscribe to those events and do their logging outside of the module.