]>
git.r.bdr.sh - rbdr/cologne/blob - lib/loggers/console.js
3dc4b1df76f89abcde975b5eeeb89f4e15f987ff
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
];
33 log : function (logObject
) {
36 message
= this.format(logObject
);
38 switch (logObject
._level
){
43 this.console
.error(message
);
46 this.console
.warn(message
);
50 this.console
.info(message
);
54 this.console
.log(message
);
59 format : function (logObject
) {
60 // Usually what you want to do here is format. Preferably using
61 // someone inside Cobalt.Formatter
63 return this.formatter
.format(logObject
, this.formatterOpts
);
71 if (typeof require
=== 'function') {
72 global
.JsConsole
= Cobalt
.Logger
.JsConsole
;
74 global
.Cobalt
.Logger
.JsConsole
= Cobalt
.Logger
.JsConsole
;
76 }(typeof window
!== 'undefined' ? window : (typeof exports
!== 'undefined' ? exports : self
)));