I should mention that I only leave console.log statements in production code for rare cases (like noting an http server was created and is listening). I try to never do it in libraries I publish because my users might not care about that information.
I like the idea of https://github.com/visionmedia/debug for user-configurable (via environment variables) debug logs. Node core has something like this built-in as well. On Tue, Aug 7, 2012 at 12:26 PM, Arnout Kazemier <i...@3rd-eden.com> wrote: > Nope most libs create their own logging libs or make it really hard to > silence the logs. Console log statements are a pita because as a developer > you really dont want to override build in functionality because some module > is using that as a "logger" > > On 7 aug. 2012, at 18:55, kuhnza <david.s.k...@gmail.com> wrote: > > Not a bad idea. Are you aware of any other libraries that do this? Trying to > gauge how common this approach is. > > On Tuesday, August 7, 2012 7:59:10 AM UTC-7, 3rdEden wrote: >> >> Just create an EventEmitter instance and emit your log events to there. >> People who then want to have logging enabled can hook up their own logging >> library. Or just listen to the emitted log messages using console.log >> >> On Monday 6 August 2012 at 22:08, kuhnza wrote: >> >> One thing I am keen to know right off the bat is what's the standard >> practice for logging within node libraries? Right now mule simply uses >> console.log but I don't think this is an ideal solution. >> >> What are others doing here? >> >> On Monday, August 6, 2012 10:32:52 AM UTC-7, kuhnza wrote: >> >> Hey guys & girls, >> >> First time open sourcing something for the node community. Hope some find >> it useful. You can get it here: >> >> https://github.com/Hubify/node-mule, or here; >> npm install mule >> >> We created it for use at Hubify after trying some of the other options out >> there such as Q-Oper8 and found they weren't particularly up to date or >> suited to our problem. >> >> We'd love to hear your suggestions on how it could be made it better. >> >> Cheers, >> Dave >> >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nodejs@googlegroups.com >> To unsubscribe from this group, send email to >> nodejs+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> >> > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en