]>
git.r.bdr.sh - rbdr/cologne/blob - lib/loggers/console.js
50025022a97f8b087c34ddca80e02b7534c6d301
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
.JsConsole
= Class(Cobalt
.Logger
, 'JsConsole')({
22 init : function (config
) {
27 for (property
in config
) {
28 logger
[property
] = config
[property
];
34 var i
, messageArray
= [], message
, severity
;
36 for (i
= 0; i
< arguments
.length
; i
++) {
37 messageArray
.push(this.format(arguments
[i
]));
39 severity
= arguments
[i
]._level
43 message
= messageArray
.join(' ');
50 this.console
.error(message
);
53 this.console
.warn(message
);
57 this.console
.info(message
);
61 this.console
.log(message
);
66 format : function (logObject
) {
67 // Usually what you want to do here is format. Preferably using
68 // someone inside Cobalt.Formatter
70 return this.formatter
.format(logObject
, this.formatterOpts
);
78 if (Cobalt
.Logger
.JsConsole
.__objectSpy
) {
79 Cobalt
.Logger
.JsConsole
.__objectSpy
.destroy();
82 if (typeof require
=== 'function') {
83 global
.JsConsole
= Cobalt
.Logger
.JsConsole
;
85 global
.Cobalt
.Logger
.JsConsole
= Cobalt
.Logger
.JsConsole
;
87 }(typeof window
!== 'undefined' ? window : (typeof exports
!== 'undefined' ? exports : self
)));