]>
git.r.bdr.sh - rbdr/cologne/blob - lib/loggers/socket.js
1 if (typeof require
=== 'function') {
2 var ioClient
= require('socket.io-client');
5 Class(Cobalt
.Logger
, 'Socket')({
9 init : function (config
) {
13 for (property
in config
) {
14 logger
[property
] = config
[property
];
18 if (!logger
.socketIo
) {
19 logger
.socketIo
= ioClient
;
22 logger
._socket
= logger
.socketIo
.connect(logger
.serverUrl
);
26 var i
, messageArray
= [];
28 for (i
= 0; i
< arguments
.length
; i
++) {
29 messageArray
.push(arguments
[i
]);
33 this._socket
.emit('log', messageArray
);