TJ's lib looks alright, having the option to control via environment 
variables is probably an acceptable solution.

This discussion has led me to delve a little deeper into the winston source 
code and I think there's a problem there for which I've raised an 
issue/pull request on GitHub 
(https://github.com/flatiron/winston/issues/162). To your original point 
Tim I think I should be able to override console.log without nasty side 
effects and redirect those messages to my logging implementation of choice. 
The current implementation of winston makes that impossible.

Maybe that combined with some environment vars to suppress logging is the 
way to go?

On Tuesday, August 7, 2012 11:31:18 AM UTC-7, 3rdEden wrote:
>
> debug is quite okay, but again, the problem with it is that you cannot 
> supply it your own logging
> instance, it writes it to console.log and console.error.
>
> On Tuesday, August 7, 2012 at 7:58 PM, Tim Caswell wrote:
>
> Matt, David,
>
> Ignore what I said about how I use console.log, but what do you think
> about TJ's debug library? To me it seems to solve your problems in a
> really elegant way.
>
> On Tue, Aug 7, 2012 at 12:44 PM, kuhnza <[email protected]> wrote:
>
> Found this discussion on the lists from last year:
> https://groups.google.com/forum/?fromgroups#!topic/nodejs/YoHblrE8JJM but 
> it
> appears as though the discussion stalled.
>
> One of the comments says it's pretty easy to re-route console output which
> is true, but what do you do in the instance that your logging framework of
> choice is also logging to console? Surely you shouldn't have to sift 
> through
> looking for what to keep and what to throw away/reformat...or am I looking
> at this the wrong way?
>
>
> On Tuesday, August 7, 2012 10:32:40 AM UTC-7, Matt Sergeant wrote:
>
>
> I agree - it's not right. It's very annoying to have libraries do no
> logging at all. It's fine when they work... but when they go wrong I want
> logs!
>
> On Tue, Aug 7, 2012 at 1:30 PM, kuhnza <[email protected]> wrote:
>
>
> That's my feeling also. Just did a quick survey of my node_modules folder
> and found that most libs in there simply don't perform any logging at all
> (or even if they once did it's been stripped out). It's almost as though
> folks have thrown it in the too hard basket and moved on. Doesn't feel
> right.
>
> On Tuesday, August 7, 2012 10:26:08 AM UTC-7, 3rdEden 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 <[email protected]> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to