Refactor console logging code.

Util.Debug, Util.Info, Util.Warn, Util.Error routines instead of
direct calls to console.*. Add "logging=XXX" query variable that sets
the logging level (default is "warn").

Logging values:
    debug: code debug logging (many calls in performance path are also
           commented for performance reasons).
    info: informative messages including timing information.
    warn: significant events
    error: something has gone wrong
This commit is contained in:
Joel Martin
2010-07-06 11:56:13 -05:00
parent 351a1da304
commit 81e5adafef
5 changed files with 201 additions and 191 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ decode: function (data, offset) {
var padding = (data.charAt(i) == pad);
// Skip illegal characters and whitespace
if (c == -1) {
console.log("Illegal character '" + data.charCodeAt(i) + "'");
console.error("Illegal character '" + data.charCodeAt(i) + "'");
continue;
}