Cobalt.Logger.JsConsole = Class(Cobalt.Logger, 'JsConsole')({
prototype : {
- console : console,
+ console : null,
formatterOpts : {},
init : function (config) {
logger[property] = config[property];
}
}
+
+ if (!logger.console) {
+ logger.console = console;
+ }
},
- log : function (logObject) {
- var message;
+ log : function () {
+ var i, messageArray = [], message, severity;
- message = this.format(logObject);
+ for (i = 0; i < arguments.length; i++) {
+ messageArray.push(this.format(arguments[i]));
+ if (!severity) {
+ severity = arguments[i]._level
+ }
+ }
- switch (logObject._level){
+ message = messageArray.join(' ');
+
+ switch (severity){
case 0:
case 1:
case 2:
}
});
+ if (Cobalt.Logger.JsConsole.__objectSpy) {
+ Cobalt.Logger.JsConsole.__objectSpy.destroy();
+ }
+
if (typeof require === 'function') {
global.JsConsole = Cobalt.Logger.JsConsole;
} else {