From ce217977c4a15a4e1f7de5c45c7f693e6093caa4 Mon Sep 17 00:00:00 2001 From: Farrin Reid Date: Sat, 23 Jun 2012 19:18:36 -0800 Subject: [PATCH] [fix] Changed require('util') to require('util') for compatibility with node v0.8 --- ioserver/ioserver.js | 2 +- ioserver/sessions.js | 4 ++-- shelld/shelld.js | 8 ++++---- webclient/app.js | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ioserver/ioserver.js b/ioserver/ioserver.js index 04f3049..f6f6094 100644 --- a/ioserver/ioserver.js +++ b/ioserver/ioserver.js @@ -3,7 +3,7 @@ */ var config = require('./safe-config.js'), - sys = require('sys'), + util = require('util'), util = require('util'), io = module.exports = require('socket.io'); diff --git a/ioserver/sessions.js b/ioserver/sessions.js index f6fa5e1..fbbbd3e 100644 --- a/ioserver/sessions.js +++ b/ioserver/sessions.js @@ -5,7 +5,7 @@ /* Temporary in memory database for User Sessions */ var _sessions = [], lib = module.exports = {}, - sys = require('sys'), + util = require('util'), config = require('./safe-config.js'), cradle, cradle_con, users_db, db_name; @@ -30,7 +30,7 @@ if(config.couchdb) { setup(function(err, db) { if(err) { - console.log('Error: ' + sys.inspect(err)); + console.log('Error: ' + util.inspect(err)); return; } if(db) { diff --git a/shelld/shelld.js b/shelld/shelld.js index 6efb2bb..d0c7a89 100755 --- a/shelld/shelld.js +++ b/shelld/shelld.js @@ -5,7 +5,7 @@ var init = require('init'), fs = require('fs'), path = require('path'), util = require('util'), - sys = require('sys'), + util = require('util'), config = {}; /* Read (optional) configuration file */ @@ -38,7 +38,7 @@ var init = require('init'), } if(arg === 'config') { console.log('Config from file `' + file + "`:" ); - console.log(sys.inspect(config)); + console.log(util.inspect(config)); exit = true; } @@ -81,7 +81,7 @@ init.simple({ // Let's log every icecap event //icecap.on('event', function(name, tokens) { - // util.log("DEBUG: icecap.on(event): " + sys.inspect(name) + ": " + sys.inspect(tokens) ); + // util.log("DEBUG: icecap.on(event): " + util.inspect(name) + ": " + util.inspect(tokens) ); //}); // Lets handle errors @@ -100,7 +100,7 @@ init.simple({ icecap.on('event', icecap_event); website_socket.on('icecap.command', function(name, tokens) { - util.log("DEBUG: website_socket.on(client-event): " + sys.inspect(name) + ": " + sys.inspect(tokens) ); + util.log("DEBUG: website_socket.on(client-event): " + util.inspect(name) + ": " + util.inspect(tokens) ); icecap.command(name, tokens); }); diff --git a/webclient/app.js b/webclient/app.js index 8503347..0d8004b 100644 --- a/webclient/app.js +++ b/webclient/app.js @@ -5,7 +5,7 @@ var app = module.exports = {}, config = require('./safe-config.js'), express = require('express'), - sys = require('sys'), + util = require('util'), util = require('util'), params = require('express-params'), namespace = require('express-namespace'), @@ -96,7 +96,7 @@ app.get('/intro', function(req, res) { // Browser requests gravator url browser.on('get-gravatar', function(email, options, https) { - console.log('EVENT: get-gravatar: ' + sys.inspect(email) + ", " + sys.inspect(options) + ", " + sys.inspect(https)); + console.log('EVENT: get-gravatar: ' + util.inspect(email) + ", " + util.inspect(options) + ", " + util.inspect(https)); var undefined, options = options || {}, https = https || false, @@ -106,7 +106,7 @@ app.get('/intro', function(req, res) { url = email ? gravatar.url(email, options, https) : ''; } finally { if(!url) url = ''; - console.log('Emiting URL: ' + sys.inspect(url)); + console.log('Emiting URL: ' + util.inspect(url)); browser.emit('set-gravatar', email, url, options, https); } }); @@ -116,7 +116,7 @@ app.get('/intro', function(req, res) { console.log('Client requested new api key'); sessions.create(function(err, sess) { if(err) { - console.log('Error: ' + sys.inspect(err)); + console.log('Error: ' + util.inspect(err)); browser.emit('error', 'Failed to create apikey'); browser.emit('join-failed'); browser.emit('rejected-apikey'); @@ -130,7 +130,7 @@ app.get('/intro', function(req, res) { // Browser joins with an API key browser.on('join', function(apikey) { - console.log( 'DEBUG: browser joins with apikey = ' + sys.inspect(apikey) ); + console.log( 'DEBUG: browser joins with apikey = ' + util.inspect(apikey) ); if(session) { console.log('Error: This browser was already joined to session.'); browser.emit('error', 'This browser was already joined to session!'); @@ -156,7 +156,7 @@ app.get('/intro', function(req, res) { // Browser sends an icecap.command event browser.on('icecap.command', function(name, tokens) { - console.log( 'DEBUG: browser.on(icecap.command): ' + sys.inspect(name) + ": " + sys.inspect( tokens ) ); + console.log( 'DEBUG: browser.on(icecap.command): ' + util.inspect(name) + ": " + util.inspect( tokens ) ); session && session.shell && session.shell.emit('icecap.command', name, tokens); }); @@ -164,7 +164,7 @@ app.get('/intro', function(req, res) { browser.once('disconnect', function () { console.log( 'DEBUG: browser disconnected'); session && session.browser && session.part(browser); - //console.log('session = ' + sys.inspect(session)); + //console.log('session = ' + util.inspect(session)); browser.removeAllListeners('icecap.command'); browser.removeAllListeners('join'); browser.removeAllListeners('create'); @@ -182,7 +182,7 @@ app.get('/intro', function(req, res) { shell.on('create', function() { sessions.create(function(err, sess) { if(err) { - console.log('Error: ' + sys.inspect(err)); + console.log('Error: ' + util.inspect(err)); shell.emit('join-failed'); shell.emit('rejected-apikey'); shell.emit('error', 'Failed to create apikey'); @@ -196,7 +196,7 @@ app.get('/intro', function(req, res) { // Shell joins with an API key shell.on('join', function(apikey) { - console.log( 'DEBUG: shell joins with apikey = ' + sys.inspect(apikey) ); + console.log( 'DEBUG: shell joins with apikey = ' + util.inspect(apikey) ); if(session) { console.log('Error: This shell was already joined to session.'); shell.emit('join-failed'); @@ -223,9 +223,9 @@ app.get('/intro', function(req, res) { // Shell sends an icecap-event, we proxy it to the browser shell.on('icecap-event', function(name, tokens) { - console.log( 'DEBUG: shell.on(icecap-event): ' + sys.inspect(name) + ": " + sys.inspect( tokens ) ); + console.log( 'DEBUG: shell.on(icecap-event): ' + util.inspect(name) + ": " + util.inspect( tokens ) ); session && session.browser && session.browser.emit('icecap-event', name, tokens); - console.log('session = ' + sys.inspect(session)); + console.log('session = ' + util.inspect(session)); }); // Shell daemon disconnects