* adding a 'none' logging level and setit by default

This commit is contained in:
primalmotion
2010-07-29 17:55:33 +02:00
parent 9fc59562a1
commit 78223532ce
+6 -5
View File
@@ -35,10 +35,11 @@ Util.init_logging = function (level) {
Util.Debug = Util.Info = Util.Warn = Util.Error = function (msg) {}; Util.Debug = Util.Info = Util.Warn = Util.Error = function (msg) {};
switch (level) { switch (level) {
case 'debug': Util.Debug = function (msg) { /*console.log(msg);*/ }; case 'none': break;
case 'info': Util.Info = function (msg) { /*console.log(msg);*/ }; case 'debug': Util.Debug = function (msg) { console.log(msg); };
case 'warn': Util.Warn = function (msg) { /*console.warn(msg);*/ }; case 'info': Util.Info = function (msg) { console.log(msg); };
case 'error': Util.Error = function (msg) { /*console.error(msg);*/ }; case 'warn': Util.Warn = function (msg) { console.warn(msg); };
case 'error': Util.Error = function (msg) { console.error(msg); };
break; break;
default: default:
throw("invalid logging type '" + level + "'"); throw("invalid logging type '" + level + "'");
@@ -47,7 +48,7 @@ Util.init_logging = function (level) {
// Initialize logging level // Initialize logging level
Util.init_logging( (document.location.href.match( Util.init_logging( (document.location.href.match(
/logging=([A-Za-z0-9\._\-]*)/) || /logging=([A-Za-z0-9\._\-]*)/) ||
['', 'error'])[1] ); ['', 'none'])[1] );
/* /*
* Simple DOM selector by ID * Simple DOM selector by ID