diff options
author | wei <> | 2006-09-16 03:43:02 +0000 |
---|---|---|
committer | wei <> | 2006-09-16 03:43:02 +0000 |
commit | 2d8fc0f1818aa896bebedf8cbeedffb17d048600 (patch) | |
tree | 2ef6ea939d5f018598ec2983086354000750fb70 /framework/Web/Javascripts/js/compressed/logger.js | |
parent | d148330f1fe3cb6116a69e56ecd44c37bfb2a44e (diff) |
Fixed #340
Diffstat (limited to 'framework/Web/Javascripts/js/compressed/logger.js')
-rw-r--r-- | framework/Web/Javascripts/js/compressed/logger.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/js/compressed/logger.js b/framework/Web/Javascripts/js/compressed/logger.js index aaef1482..728c81e5 100644 --- a/framework/Web/Javascripts/js/compressed/logger.js +++ b/framework/Web/Javascripts/js/compressed/logger.js @@ -26,7 +26,15 @@ return cookieArray},clear:function(name){this.set(name,"",-1)},clearAll:function for(var i=0;i<cookies.length;i++){this.clear(cookies[i].name)}}} Logger={logEntries:[],onupdate:new CustomEvent(),onclear:new CustomEvent(),log:function(message,tag){var logEntry=new LogEntry(message,tag||"info") this.logEntries.push(logEntry) -this.onupdate.dispatch(logEntry)},info:function(message){this.log(message,'info')},debug:function(message){this.log(message,'debug')},warn:function(message){this.log(message,'warning')},error:function(message,error){this.log(message+": \n"+error,'error')},clear:function(){this.logEntries=[] +this.onupdate.dispatch(logEntry)},info:function(message){this.log(message,'info') +if(typeof(console)!="undefined") +console.info(message);},debug:function(message){this.log(message,'debug') +if(typeof(console)!="undefined") +console.debug(message);},warn:function(message){this.log(message,'warning') +if(typeof(console)!="undefined") +console.warn(message);},error:function(message,error){this.log(message+": \n"+error,'error') +if(typeof(console)!="undefined") +console.error(message);},clear:function(){this.logEntries=[] this.onclear.dispatch()}} LogEntry=Class.create() LogEntry.prototype={initialize:function(message,tag){this.message=message |