@senx/discovery-widgets
Version:
Discovery Widgets Elements
2 lines • 1.27 kB
JavaScript
var Logger=function(){function o(o,n){if(n===void 0){n=false}this.isDebug=false;this.className=o.name;this.isDebug=n}o.prototype.log=function(o,n,s){var e=[];e.push("[".concat((new Date).toISOString()," - [").concat(this.className,"] ").concat(n.join(" - ")));e=e.concat(s);switch(o){case LEVEL.DEBUG:{if(this.isDebug){console.debug.apply(console,e)}break}case LEVEL.ERROR:{console.error.apply(console,e);break}case LEVEL.INFO:{console.log.apply(console,e);break}case LEVEL.WARN:{console.warn.apply(console,e);break}default:{if(this.isDebug){console.log.apply(console,e)}}}};o.prototype.debug=function(o){var n=[];for(var s=1;s<arguments.length;s++){n[s-1]=arguments[s]}this.log(LEVEL.DEBUG,o,n)};o.prototype.error=function(o){var n=[];for(var s=1;s<arguments.length;s++){n[s-1]=arguments[s]}this.log(LEVEL.ERROR,o,n)};o.prototype.warn=function(o){var n=[];for(var s=1;s<arguments.length;s++){n[s-1]=arguments[s]}this.log(LEVEL.WARN,o,n)};o.prototype.info=function(o){var n=[];for(var s=1;s<arguments.length;s++){n[s-1]=arguments[s]}this.log(LEVEL.INFO,o,n)};return o}();var LEVEL;(function(o){o[o["DEBUG"]=0]="DEBUG";o[o["ERROR"]=1]="ERROR";o[o["WARN"]=2]="WARN";o[o["INFO"]=3]="INFO"})(LEVEL||(LEVEL={}));export{Logger as L};
//# sourceMappingURL=logger-7b3179cb.js.map