loglevel-plugin-prefix.system.min.js 2.0 KB
Newer Older
1
System.register([],function(b){"use strict";return{execute:function(){var P=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function O(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var c={exports:{}};(function(i){(function(l,u){i.exports?i.exports=u():l.prefix=u(l)})(P,function(l){var u=function(e){for(var t=1,m=arguments.length,n;t<m;t++)for(n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e},T={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},d,o={},j=function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");d=e},k=function(e,t){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var m=e.methodFactory,n=e.name||"",A=o[n]||o[""]||T;function C(y,D,s){var L=m(y,D,s),a=o[s]||o[""],M=a.template.indexOf("%t")!==-1,S=a.template.indexOf("%l")!==-1,_=a.template.indexOf("%n")!==-1;return function(){for(var r="",g=arguments.length,f=Array(g),v=0;v<g;v++)f[v]=arguments[v];if(n||!o[s]){var x=a.timestampFormatter(new Date),w=a.levelFormatter(y),F=a.nameFormatter(s);a.format?r+=a.format(w,F,x):(r+=a.template,M&&(r=r.replace(/%t/,x)),S&&(r=r.replace(/%l/,w)),_&&(r=r.replace(/%n/,F))),f.length&&typeof f[0]=="string"?f[0]=r+" "+f[0]:f.unshift(r)}L.apply(void 0,f)}}return o[n]||(e.methodFactory=C),t=t||{},t.template&&(t.format=void 0),o[n]=u({},A,t),e.setLevel(e.getLevel()),d||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e},p={reg:j,apply:k},h;return l&&(h=l.prefix,p.noConflict=function(){return l.prefix===p&&(l.prefix=h),p}),p})})(c);var E=c.exports,$=b("default",O(E))}}});