]>
git.r.bdr.sh - rbdr/cologne/blob - lib/loggers/socket.js
ea9d94459c346f9d72d87162197bf06bb5f53434
4 // Load up dependencies
5 if (typeof require
=== 'function') {
6 var Ne
= require('neon');
10 Module
= global
.Module
;
15 Module(Cobalt
, 'Logger')({});
17 Cobalt
.Logger
.Socket
= Class(Cobalt
.Logger
, 'Socket')({
21 init : function (config
) {
24 logger
.socketIo
= global
.io
27 for (property
in config
) {
28 logger
[property
] = config
[property
];
32 if (logger
.socketIo
) {
33 logger
._socket
= logger
.socketIo
.connect(logger
.serverUrl
);
38 var i
, messageArray
= [];
40 for (i
= 0; i
< arguments
.length
; i
++) {
41 messageArray
.push(arguments
[i
]);
45 this._socket
.emit('log', messageArray
);
51 if (Cobalt
.Logger
.Socket
.__objectSpy
) {
52 Cobalt
.Logger
.Socket
.__objectSpy
.destroy();
55 if (typeof require
=== 'function') {
56 global
.Socket
= Cobalt
.Logger
.Socket
;
58 global
.Cobalt
.Logger
.Socket
= Cobalt
.Logger
.Socket
;
60 }(typeof window
!== 'undefined' ? window : (typeof exports
!== 'undefined' ? exports : self
)));