var root,definition;root=window,definition=function(){var noop=function(){},isIE="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),logMethods=["trace","debug","info","warn","error"];function bindMethod(obj,methodName){var method=obj[methodName];if("function"==typeof method.bind)return method.bind(obj);try{return Function.prototype.bind.call(method,obj)}catch(e){return function(){return Function.prototype.apply.apply(method,[obj,arguments])}}}function traceForIE(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function realMethod(methodName){return"debug"===methodName&&(methodName="log"),"undefined"!=typeof console&&("trace"===methodName&&isIE?traceForIE:void 0!==console[methodName]?bindMethod(console,methodName):void 0!==console.log?bindMethod(console,"log"):noop)}function replaceLoggingMethods(level,loggerName){for(var i=0;i=0&&level<=self.levels.SILENT))throw"log.setLevel() called with invalid level: "+level;if(currentLevel=level,!1!==persist&&function(levelNum){var levelName=(logMethods[levelNum]||"silent").toUpperCase();if("undefined"!=typeof window&&storageKey){try{return void(window.localStorage[storageKey]=levelName)}catch(ignore){}try{window.document.cookie=encodeURIComponent(storageKey)+"="+levelName+";"}catch(ignore){}}}(level),replaceLoggingMethods.call(self,level,name),"undefined"==typeof console&&level