init : function (config) {
var logger = this;
- logger.socketIo = io;
+
+ logger.socketIo = global.io
if (config) {
for (property in config) {
}
}
- logger._socket = logger.socketIo.connect(logger.serverUrl);
+ if (logger.socketIo) {
+ logger._socket = logger.socketIo.connect(logger.serverUrl);
+ }
},
log : function () {
messageArray.push(arguments[i]);
}
- this._socket.emit('log', messageArray);
+ if (this._socket) {
+ this._socket.emit('log', messageArray);
+ }
}
}
});