// Load up dependencies
if (typeof require === 'function') {
var Ne = require('neon');
+ var ioClient = require('socket.io-client');
Module = Ne.Module;
Class = Ne.Class;
} else {
init : function (config) {
var logger = this;
- logger.socketIo = io;
if (config) {
for (property in config) {
}
}
+ if (!logger.socketIo) {
+ logger.socketIo = ioClient;
+ }
+
logger._socket = logger.socketIo.connect(logger.serverUrl);
},
messageArray.push(arguments[i]);
}
- this._socket.emit('log', messageArray);
+ if (this._socket) {
+ this._socket.emit('log', messageArray);
+ }
}
}
});