Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
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:/

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Arnout Kazemier
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

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Matt
On Tue, Aug 7, 2012 at 1: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. > Yup absolutely. And I much prefer being able to control thes

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Tim Caswell
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 wrote: > Found this discussion on the lists from last year: > https://groups.google

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
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

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Matt
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 wrote: > That's my feeling also. Just did a quick survey of my node_modules folder > and found that most lib

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
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 rig

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Tim Caswell
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/visionme

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Arnout Kazemier
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 wrote: >

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
Yeah that's exactly what I'm trying to avoid too Matt. I hate it when libs indiscriminately fill up my logs with no easy way to control the verbosity/formatting of their messages. Is there anything like SLF4J for node? That way you could simply set the logging implementation at the module level

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Matt
On Tue, Aug 7, 2012 at 11:28 AM, Tim Caswell wrote: > On Tue, Aug 7, 2012 at 9:54 AM, Matt wrote: > > I prefer if you at least have a level of indirection away from > console.log, > > so that I can override it (or pass in a "log" function to a constructor > of > > some sort) without having to st

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
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 c

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread kuhnza
Thanks Tim. Based on what you're saying I'm leaning to just leaving the console.log statements in there. Though, I'm a little unclear on how you'd actually go about overriding console.(log|warn|error) etc. in client code. Are you able to provide an example of how you'd do it? Something like th

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Thomas Blobaum
I use console.log with rconsole which adds some extra functionality https://github.com/tblobaum/rconsole Thomas Blobaum On Mon, Aug 6, 2012 at 3:08 PM, 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

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Tim Caswell
On Tue, Aug 7, 2012 at 9:54 AM, Matt wrote: > I prefer if you at least have a level of indirection away from console.log, > so that I can override it (or pass in a "log" function to a constructor of > some sort) without having to stomp on console.log. The thing is, what is the purpose of console.

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Arnout Kazemier
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

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Matt
I prefer if you at least have a level of indirection away from console.log, so that I can override it (or pass in a "log" function to a constructor of some sort) without having to stomp on console.log. On Mon, Aug 6, 2012 at 4:08 PM, kuhnza wrote: > One thing I am keen to know right off the bat

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-07 Thread Tim Caswell
It's only "bad form" if it doesn't fit your use case. Every situation is different. That's the nature of software. I tend to write mostly small libraries and micro-sites. Winston is overkill for me. I don't know what's best for other people because I'm not in their shoes. On Tue, Aug 7, 2012

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-06 Thread kuhnza
Interesting, thanks for that...what do you think about using something like winston (which we currently use for all our custom stuff)? Do the same principle still apply, or is it bad form to use third-party logging in libs? Dave On Monday, August 6, 2012 8:45:07 PM UTC-7, Tim Caswell wrote: > >

Re: [nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-06 Thread Tim Caswell
I use console.log. I override the function when I want to redirect the output. On Mon, Aug 6, 2012 at 3:08 PM, 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 t

[nodejs] Re: Introducting Mule - A worker process pool for CPU intensive tasks

2012-08-06 Thread kuhnza
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 guy