From 40966766528cf098ca0613883c160725631ad7a9 Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 18 Aug 2013 01:03:38 +0100 Subject: [PATCH] ControlInterface output to its stream --- server/controlinterface.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/controlinterface.js b/server/controlinterface.js index 2d0a88a..89bd4dc 100644 --- a/server/controlinterface.js +++ b/server/controlinterface.js @@ -84,25 +84,26 @@ commands.stats = function(args, raw) { commands.reconfig = function(args, raw) { if (config.loadConfig()) { - console.log('New config file loaded'); + this.write('New config file loaded'); } else { - console.log("No new config file was loaded"); + this.write("No new config file was loaded"); } }; commands.rehash = function(args, raw) { rehash.rehashAll(); - console.log('Rehashed'); + this.write('Rehashed'); }; commands.jumpserver = function(args, raw) { - var num_clients = _.size(global.clients.clients), + var that = this, + num_clients = _.size(global.clients.clients), packet = {}, args_idx; if (num_clients === 0) { - console.log('No connected clients'); + this.write('No connected clients'); return; } @@ -113,9 +114,9 @@ commands.jumpserver = function(args, raw) { packet.kiwi_server = args[args_idx]; - console.log('Broadcasting jumpserver to ' + num_clients.toString() + ' clients..'); + this.write('Broadcasting jumpserver to ' + num_clients.toString() + ' clients..'); global.clients.broadcastKiwiCommand('jumpserver', packet, function() { - console.log('Broadcast complete.'); + that.write('Broadcast complete.'); }); }; -- 2.25.1