Author: reebalazs
Date: Fri Nov 30 10:48:56 2007
New Revision: 49222

Modified:
   kukit/kukit.js/branch/ree-loglevels/kukit/utils.js
Log:
Make filtering in a central place, according to Jeroen's suggestion but little 
differently.

Modified: kukit/kukit.js/branch/ree-loglevels/kukit/utils.js
==============================================================================
--- kukit/kukit.js/branch/ree-loglevels/kukit/utils.js  (original)
+++ kukit/kukit.js/branch/ree-loglevels/kukit/utils.js  Fri Nov 30 10:48:56 2007
@@ -112,6 +112,12 @@
 ;;;     };
         // Call the function that sets up the handlers
         this._setupHandlers();
+        // Wrap the just set up handlers, to include wrapping
+;;;     this.logDebug = this._logFilter(this.logDebug, 0);
+;;;     this.log = this._logFilter(this.log, 1);
+;;;     this.logWarning = this._logFilter(this.logWarning, 2);
+;;;     this.logError = this._logFilter(this.logError, 3);
+;;;     this.logFatal = this._logFilter(this.logFatal, 3);
     };
 
     // Log filter, for use from the handlers.
@@ -169,11 +175,11 @@
 ;;;     kukit._logger._setupHandlers = function() {
 ;;;         // for debug level we also log as 'info', because we do
 ;;;         // not want FireBug to display line information.
-;;;         this.logDebug = this._logFilter(console.log, 0);
-;;;         this.log = this._logFilter(console.log, 1);
-;;;         this.logWarning = this._logFilter(console.warn, 2);
-;;;         this.logError = this._logFilter(console.error, 3);
-;;;         this.logFatal = this._logFilter(console.error, 3);
+;;;         this.logDebug = console.log;
+;;;         this.log = console.log;
+;;;         this.logWarning = console.warn;
+;;;         this.logError = console.error;
+;;;         this.logFatal = console.error;
 ;;;     }
 ;;; }
 
@@ -188,11 +194,11 @@
 ;;; // Set up logging for MochiKit
 ;;; if (! kukit.hasFirebug && kukit.hasMochiKit) {
 ;;;     kukit._logger._setupHandlers = function() {
-;;;         this.logDebug = this._logFilter(MochiKit.Logging.logDebug, 0);
-;;;         this.log = this._logFilter(MochiKit.Logging.log, 1);
-;;;         this.logWarning = this._logFilter(MochiKit.Logging.logWarning, 2);
-;;;         this.logError = this._logFilter(MochiKit.Logging.logError, 3);
-;;;         this.logFatal = this._logFilter(MochiKit.Logging.logFatal, 3);
+;;;         this.logDebug = MochiKit.Logging.logDebug;
+;;;         this.log = MochiKit.Logging.log;
+;;;         this.logWarning = MochiKit.Logging.logWarning;
+;;;         this.logError = MochiKit.Logging.logError;
+;;;         this.logFatal = MochiKit.Logging.logFatal;
 ;;;     }
 ;;;     // make convenience url
 ;;;     //    javascript:kukit.showLog();
@@ -213,11 +219,11 @@
 ;;; // Set up logging for Safari
 ;;; if (! kukit.hasFirebug && ! kukit.hasMochiKit && kukit.hasSafari) {
 ;;;     kukit._logger._setupHandlers = function() {
-;;;         this.logDebug = this._logFilter(function(str) { 
console.log('DEBUG: '+str); }, 0);
-;;;         this.log = this._logFilter(function(str) { console.log('INFO: 
'+str); }, 1);
-;;;         this.logWarning = this._logFilter(function(str) { 
console.log('WARNING: '+str); }, 2);
-;;;         this.logError = this._logFilter(function(str) { 
console.log('ERROR: '+str); }, 3);
-;;;         this.logFatal = this._logFilter(function(str) { 
console.log('FATAL: '+str); }, 3);
+;;;         this.logDebug = function(str) { console.log('DEBUG: '+str); };
+;;;         this.log = function(str) { console.log('INFO: '+str); };
+;;;         this.logWarning = function(str) { console.log('WARNING: '+str); };
+;;;         this.logError = function(str) { console.log('ERROR: '+str); };
+;;;         this.logFatal = function(str) { console.log('FATAL: '+str); };
 ;;;     }
 ;;; }
 
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to