joyent/node — Issue #1939: Add option to silence cluster debug output
Author: JonnyLitt
Created: 2011-10-25 19:01:48+00:00
State: open

The output from the cluster information regarding CPU count and workers that come online can sometimes get in the way of Node.js applications. I'm currently trying it out on my cluster of *42* CPUs and it spams up the console for each CPU. It'd be helpful to have this output removed or at least switchable.

It could be implemented as a second argument to `cluster` like so:
`node cluster quiet test.js`

or even better, have it default to silent and have the option to explicitly have verbosity:
`node cluster verbose test.js`

### Useful information

The output comes from lines 62-63 of the `start()` method

var cpus = require('os').cpus().length;
console.error("Detected " + cpus + " cpus");

*and* lines 93-94 of the `handleWorkerMessage()` method

case 'online':
console.log("Worker " + worker.pid + " online");

of **cluster.js**