Permalink
Browse files

Node 0.6.x compat changes

Removed require('sys')
Used util instead of logger where inspect and puts was being used.
  • Loading branch information...
1 parent b84a8b0 commit ab3311bc6a8f0f505d262baa21229487cf832099 @sreeix sreeix committed Dec 7, 2011
Showing with 13 additions and 19 deletions.
  1. +0 −1 api.js
  2. +0 −1 plugins/history/history_plugin.js
  3. +0 −1 plugins/mail/mail_plugin.js
  4. +4 −5 plugins/twitter/twitter_plugin.js
  5. +9 −10 server.js
  6. +0 −1 settings.js
View
@@ -1,7 +1,6 @@
var http = require('http');
var https = require('https');
var net = require('net');
-var sys = require('sys');
var fs = require('fs');
var logger = require('util');
var _ = require('underscore')._;
@@ -1,5 +1,4 @@
var logger = require('util');
-var sys = require('sys');
var client;
var mysettings;
@@ -1,5 +1,4 @@
var logger = require('util');
-var sys = require('sys');
exports.create = function(api, settings) {
if (settings.plugins && settings.plugins.mail && settings.plugins.mail.enable) {
@@ -1,5 +1,4 @@
-var logger = require('util');
-var sys = require('sys');
+var util = require('util');
exports.create = function(api, settings) {
if (settings.plugins && settings.plugins.twitter && settings.plugins.twitter.enable) {
@@ -15,10 +14,10 @@ exports.create = function(api, settings) {
twit.tweet = function(message, options) {
twit.verifyCredentials(function (data) {
- // logger.log("verifyCredentials: " + sys.puts(sys.inspect(data)));
+ // util.log("verifyCredentials: " + util.puts(util.inspect(data)));
}).updateStatus(message, function (data) {
- logger.log("Send a tweet: " + message);
- // logger.log("updateStatus: " + sys.puts(sys.inspect(data)));
+ util.log("Send a tweet: " + message);
+ // util.log("updateStatus: " + util.puts(util.inspect(data)));
});
};
View
@@ -1,5 +1,4 @@
-var logger = require('util');
-var sys = require('sys');
+var util = require('util');
var http = require('http');
var journey = require('journey');
var router = new(journey.Router)();
@@ -8,11 +7,11 @@ var url = require('url');
var _ = require('underscore')._;
process.on('exit', function () {
- logger.log('Bye bye Statusdashboard.');
+ util.log('Bye bye Statusdashboard.');
});
process.on('uncaughtException', function(err) {
- logger.log(err);
+ util.log(err);
});
String.prototype.startsWith = function(str) {
@@ -77,14 +76,14 @@ io.set('log level', 1);
io.sockets.on('connection', function(socket) {
count++;
- logger.log('New client connected! (' + count + ')');
+ util.log('New client connected! (' + count + ')');
socket.emit('title', settings.title);
socket.emit('status', api.getStatus());
socket.broadcast.emit('count', count);
socket.on('disconnect', function() {
count--;
- logger.log('Client disconnect! (' + count + ')');
+ util.log('Client disconnect! (' + count + ')');
socket.broadcast.emit('count', count);
});
api.on("refresh", function(status) {
@@ -97,12 +96,12 @@ api.on("routeContribution", function(route) {
});
api.on("staticContribution", function(plugin) {
- logger.log("Add static contribution: " + plugin);
+ util.log("Add static contribution: " + plugin);
var docRoot = __dirname + '/plugins/' + plugin + '/public';
pluginsDocRoot.push( { prefix: "/api/" + plugin, docRoot: docRoot });
- logger.log("Add static contribution: " + sys.inspect(pluginsDocRoot));
+ util.log("Add static contribution: " + util.inspect(pluginsDocRoot));
});
-logger.log('Server started.');
-logger.log('Server running at http://' + settings.hostname + ':' + settings.port);
+util.log('Server started.');
+util.log('Server running at http://' + settings.hostname + ':' + settings.port);
View
@@ -1,5 +1,4 @@
var os = require('os');
-var sys = require('sys');
var fs = require('fs');
var path = require("path");
var logger = require('util');

0 comments on commit ab3311b

Please sign in to comment.