diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a1537b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +node_modules diff --git a/cluster-master.js b/cluster-master.js index 17894d9..dc52a6f 100644 --- a/cluster-master.js +++ b/cluster-master.js @@ -15,6 +15,7 @@ var cluster = require("cluster") , util = require('util') , minRestartAge = 2000 , danger = false +, d = require("debug")("cluster-master") exports = module.exports = clusterMaster exports.restart = restart @@ -24,7 +25,7 @@ exports.quit = quit var debugStreams = {} function debug () { - console.error.apply(console, arguments) + d.apply(d, arguments) var msg = util.format.apply(util, arguments) Object.keys(debugStreams).forEach(function (s) { @@ -122,7 +123,7 @@ function setupRepl () { } function startRepl () { - console.error('starting repl on '+socket+'=') + debug('starting repl on '+socket+'=') process.on('exit', function() { try { fs.unlinkSync(socket) } catch (er) {} }) @@ -400,7 +401,7 @@ function resize (n, cb_) { return function cb() { - console.error('done resizing') + debug('done resizing') resizing = false var q = resizeCbs.slice(0) diff --git a/package.json b/package.json index 378c376..3d64c79 100644 --- a/package.json +++ b/package.json @@ -11,5 +11,8 @@ "engines": { "node": ">=0.7.7" }, - "license": "BSD" + "license": "BSD", + "dependencies": { + "debug": "^1.0.2" + } }