Skip to content

Commit

Permalink
[dist] Remove console.error/log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Dec 23, 2011
1 parent ed0d1e8 commit c6072f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 10 additions & 1 deletion lib/forever/service/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ app.cmd('restart', cli.restart = function () {

app.cmd('list', cli.list = function () {
service.list(function (err, applications) {
if (err) {
app.log.error('Error running command: ' + 'list'.magenta);
app.log.error(err.message);
err.stack && err.stack.split('\n').forEach(function (line) {
app.log.error(line);
})
return;
}

applications.forEach(function printApplication(application) {
console.log(application.monitor.uid, application.monitor.command, application.file, application.monitor.child.pid, application.monitor.logFile, application.monitor.pidFile);
});
Expand All @@ -88,6 +97,6 @@ app.cmd('resume', cli.resume = function () {
});

cli.startCLI = function () {
app.init(app.start);
app.start();
};

11 changes: 0 additions & 11 deletions lib/forever/service/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var Service = module.exports = function Service(options) {

AdapterType = options.adapter || SystemVAdapter;
this.adapter = new AdapterType(this);
console.log(this.adapter);
};

util.inherits(Service, events.EventEmitter);
Expand All @@ -50,11 +49,9 @@ Service.prototype.startServer = function startServer(callback) {
self = this,
server;

console.log('SS');
server = dnode(this);

portfinder.getSocket({ path: socket }, function onSocketFound(err, socket) {
console.error(arguments);
if (err) {
return callback(err);
}
Expand Down Expand Up @@ -89,17 +86,12 @@ Service.prototype.listen = function listen(server) {
this.servers.push(dnodeServer);
dnodeServer.listen(server);

setTimeout(function () {
console.error(dnodeServer);
}, 10000);

return this;
};

Service.prototype.load = function load() {
var self = this;
this.adapter.load(function onLoaded(applications) {
console.error(arguments);
applications.forEach(function startApplication(application, index) {
var monitor = application.monitor = new forever.Monitor(application.file, application.options);

Expand All @@ -123,7 +115,6 @@ Service.prototype.load = function load() {
// call's the service manager's add method
//
Service.prototype.add = function add(file, options, callback) {
console.log(arguments);
if (this.paused) {
return callback && callback(new Error('foreverd is paused'));
}
Expand Down Expand Up @@ -211,9 +202,7 @@ Service.prototype.start = function start(callback) {
Service.prototype.run = function run(callback) {
var self = this;
this.adapter.run(function adapterStarted() {
console.error(self.applications);
self.applications.forEach(function startApplication(application) {
console.error(application);
application.monitor = new forever.Monitor(application.file, application.options);
application.monitor.start();
});
Expand Down

0 comments on commit c6072f5

Please sign in to comment.