]>
git.r.bdr.sh - rbdr/cologne/blob - lib/loggers/socket.js
739c5b326852f00bc8eebc8bc5cb2c027588ac6b
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
) {
26 for (property
in config
) {
27 logger
[property
] = config
[property
];
31 logger
._socket
= logger
.socketIo
.connect(logger
.serverUrl
);
35 var i
, messageArray
= [];
37 for (i
= 0; i
< arguments
.length
; i
++) {
38 messageArray
.push(arguments
[i
]);
41 this._socket
.emit('log', messageArray
);
46 if (Cobalt
.Logger
.Socket
.__objectSpy
) {
47 Cobalt
.Logger
.Socket
.__objectSpy
.destroy();
50 if (typeof require
=== 'function') {
51 global
.Socket
= Cobalt
.Logger
.Socket
;
53 global
.Cobalt
.Logger
.Socket
= Cobalt
.Logger
.Socket
;
55 }(typeof window
!== 'undefined' ? window : (typeof exports
!== 'undefined' ? exports : self
)));