loglevel-e40a507a.js 3.0 KB

1
  1. import{c as S,g as U}from"./@amap-aca98dec.js";var E={exports:{}};(function(d){(function(c,i){d.exports?d.exports=i():c.log=i()})(S,function(){var c=function(){},i="undefined",b=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),g=["trace","debug","info","warn","error"];function y(n,t){var r=n[t];if(typeof r.bind=="function")return r.bind(n);try{return Function.prototype.bind.call(r,n)}catch{return function(){return Function.prototype.apply.apply(r,[n,arguments])}}}function I(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function C(n){return n==="debug"&&(n="log"),typeof console===i?!1:n==="trace"&&b?I:console[n]!==void 0?y(console,n):console.log!==void 0?y(console,"log"):c}function w(n,t){for(var r=0;r<g.length;r++){var o=g[r];this[o]=r<n?c:this.methodFactory(o,n,t)}this.log=this.debug}function m(n,t,r){return function(){typeof console!==i&&(w.call(this,t,r),this[n].apply(this,arguments))}}function T(n,t,r){return C(n)||m.apply(this,arguments)}function v(n,t,r){var o=this,h;t=t??"WARN";var l="loglevel";typeof n=="string"?l+=":"+n:typeof n=="symbol"&&(l=void 0);function F(e){var f=(g[e]||"silent").toUpperCase();if(!(typeof window===i||!l)){try{window.localStorage[l]=f;return}catch{}try{window.document.cookie=encodeURIComponent(l)+"="+f+";"}catch{}}}function L(){var e;if(!(typeof window===i||!l)){try{e=window.localStorage[l]}catch{}if(typeof e===i)try{var f=window.document.cookie,a=f.indexOf(encodeURIComponent(l)+"=");a!==-1&&(e=/^([^;]+)/.exec(f.slice(a))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function R(){if(!(typeof window===i||!l)){try{window.localStorage.removeItem(l);return}catch{}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}o.name=n,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=r||T,o.getLevel=function(){return h},o.setLevel=function(e,f){if(typeof e=="string"&&o.levels[e.toUpperCase()]!==void 0&&(e=o.levels[e.toUpperCase()]),typeof e=="number"&&e>=0&&e<=o.levels.SILENT){if(h=e,f!==!1&&F(e),w.call(o,e,n),typeof console===i&&e<o.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+e},o.setDefaultLevel=function(e){t=e,L()||o.setLevel(e,!1)},o.resetLevel=function(){o.setLevel(t,!1),R()},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)};var p=L();p==null&&(p=t),o.setLevel(p,!1)}var s=new v,u={};s.getLogger=function(t){if(typeof t!="symbol"&&typeof t!="string"||t==="")throw new TypeError("You must supply a name when creating a logger.");var r=u[t];return r||(r=u[t]=new v(t,s.getLevel(),s.methodFactory)),r};var x=typeof window!==i?window.log:void 0;return s.noConflict=function(){return typeof window!==i&&window.log===s&&(window.log=x),s},s.getLoggers=function(){return u},s.default=s,s})})(E);var M=E.exports;const D=U(M);export{D as l};