* 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
1 changed files with 6 additions and 5 deletions

View File

@ -35,10 +35,11 @@ Util.init_logging = function (level) {
Util.Debug = Util.Info = Util.Warn = Util.Error = function (msg) {};
switch (level) {
case 'debug': Util.Debug = function (msg) { /*console.log(msg);*/ };
case 'info': Util.Info = function (msg) { /*console.log(msg);*/ };
case 'warn': Util.Warn = function (msg) { /*console.warn(msg);*/ };
case 'error': Util.Error = function (msg) { /*console.error(msg);*/ };
case 'none': break;
case 'debug': Util.Debug = function (msg) { console.log(msg); };
case 'info': Util.Info = function (msg) { console.log(msg); };
case 'warn': Util.Warn = function (msg) { console.warn(msg); };
case 'error': Util.Error = function (msg) { console.error(msg); };
break;
default:
throw("invalid logging type '" + level + "'");
@ -47,7 +48,7 @@ Util.init_logging = function (level) {
// Initialize logging level
Util.init_logging( (document.location.href.match(
/logging=([A-Za-z0-9\._\-]*)/) ||
['', 'error'])[1] );
['', 'none'])[1] );
/*
* Simple DOM selector by ID