@dzeio/logger
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var u,c=[],s=!1,f=-1;function h(){s&&u&&(s=!1,u.length?c=u.concat(c):f=-1,c.length&&g())}function g(){if(!s){var e=a(h);s=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||s||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(2));window.Logger=o.default,window.initConsole=function(){window.console=new o.default("Console")}},function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&c(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var h=f(n(3)),g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Logger";a(this,e),this.prefix=t,this.memory=console.memory,this.Console=console.Console,this.queue=[],this.blocked=!1,this.countCount={},this.timeCount={},e.loggers.push(this),"undefined"!=typeof InstallTrigger&&(h.default.enabled=!1)}var t,n,i;return t=e,i=[{key:"isBlocked",value:function(e){var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}(this.loggers);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.blocked=e,e||r.processQueue()}}catch(e){n.e(e)}finally{n.f()}}},{key:"forceTheme",value:function(e){this.theme=e}}],(n=[{key:"assert",value:function(e){if(!e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.error.apply(this,["Assertion failed:"].concat(n))}}},{key:"clear",value:function(){console.clear()}},{key:"count",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";Object.prototype.hasOwnProperty.call(this.countCount,e)||(this.countCount[e]=0),this.log("".concat(e,":"),++this.countCount[e])}},{key:"countReset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";delete this.countCount[e]}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("debug",t)}},{key:"dir",value:function(e,t){if("object"!==l(e))return this.log(e);this.log("Method not fully implemented"),"undefined"==typeof window?console.dir(e,t):console.dir(e)}},{key:"dirxml",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("dirxml",t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("error",t)}},{key:"exception",value:function(){this.error.apply(this,arguments)}},{key:"group",value:function(){var e;(e=console).group.apply(e,arguments)}},{key:"groupCollapsed",value:function(){this.group.apply(this,arguments)}},{key:"groupEnd",value:function(){console.groupEnd()}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("info",t)}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("log",t)}},{key:"profile",value:function(e){if(!console.profile)throw new Error("profile don't exist in the current contexte");console.profile(e)}},{key:"profileEnd",value:function(e){console.profileEnd(e)}},{key:"table",value:function(e,t){console.table(e,t)}},{key:"time",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";Object.prototype.hasOwnProperty.call(this.timeCount,e)?this.warn("Timer '".concat(e,"' already exists.")):this.timeCount[e]=new Date}},{key:"timeEnd",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=(new Date).getTime()-this.timeCount[e].getTime();this.log("".concat(e,": ").concat(t,"ms - Timer ended")),delete this.timeCount[e]}},{key:"timeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";if(this.timeCount[e]){for(var t=(new Date).getTime()-this.timeCount[e].getTime(),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.log.apply(this,["".concat(e,": ").concat(t,"ms")].concat(r))}else this.warn("Timer '".concat(e,"' does not exist"))}},{key:"timeStamp",value:function(e){console.timeStamp(e)}},{key:"trace",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("trace",t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("warn",t)}},{key:"urgent",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,r(this.formatMessage(n)))}},{key:"process",value:function(e,t){this.queue.push({type:e,msg:this.formatMessage(t)}),this.processQueue()}},{key:"formatMessage",value:function(t){var n=this.prefix,r=n.length;e.prefixLen<r&&(e.prefixLen=r);var o=["",""];if(e.prefixLen>r){var i=e.prefixLen-r,a=i/2;o[0]=this.buildSpace(a-(i%2!=0?1:0)),o[1]=this.buildSpace(a)}return["".concat(this.blackOrWhite("[ ")).concat(o[0]).concat(h.blue(n)).concat(o[1]).concat(this.blackOrWhite(" ]"),":")].concat(t.map((function(e){return"object"===l(e)?e:void 0===e?h.yellow("undefined"):null===e?h.yellow("null"):"string"!=typeof e?h.yellow(e.toString()):h.green(e)})))}},{key:"processQueue",value:function(){for(;this.queue.length>0&&!this.blocked;){var e,t=this.queue.shift();t&&("trace"===t.type&&console.log(t.msg.shift()),(e=console)[t.type].apply(e,r(t.msg)))}}},{key:"buildSpace",value:function(e){for(var t="",n=0;n<e;n++)t+=" ";return t}},{key:"blackOrWhite",value:function(t){return!e.theme&&"undefined"!=typeof window||"light"===e.theme?h.black(t):h.white(t)}}])&&u(t.prototype,n),i&&u(t,i),e}();t.default=g,g.prefixLen=0,g.theme=void 0,g.loggers=[],t.logger=new g},function(e,t,n){"use strict";(function(t){const r=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{const e={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in t.env&&(e.enabled="0"!==t.env.FORCE_COLOR);const o=(e,t,n)=>"function"==typeof e?e(t):e.wrap(t,n),i=(t,n)=>{if(""===t||null==t)return"";if(!1===e.enabled)return t;if(!1===e.visible)return"";let r=""+t,i=r.includes("\n"),l=n.length;for(l>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());l-- >0;)r=o(e.styles[n[l]],r,i);return r},l=(t,n,r)=>{e.styles[t]=(e=>{let t=e.open=`[${e.codes[0]}m`,n=e.close=`[${e.codes[1]}m`,r=e.regex=new RegExp(`\\u001b\\[${e.codes[1]}m`,"g");return e.wrap=(e,o)=>{e.includes(n)&&(e=e.replace(r,n+t));let i=t+e+n;return o?i.replace(/\r*\n/g,`${n}$&${t}`):i},e})({name:t,codes:n}),(e.keys[r]||(e.keys[r]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(n){e.alias(t,n)},get(){let n=e=>i(e,n.stack);return Reflect.setPrototypeOf(n,e),n.stack=this.stack?this.stack.concat(t):[t],n}})};return l("reset",[0,0],"modifier"),l("bold",[1,22],"modifier"),l("dim",[2,22],"modifier"),l("italic",[3,23],"modifier"),l("underline",[4,24],"modifier"),l("inverse",[7,27],"modifier"),l("hidden",[8,28],"modifier"),l("strikethrough",[9,29],"modifier"),l("black",[30,39],"color"),l("red",[31,39],"color"),l("green",[32,39],"color"),l("yellow",[33,39],"color"),l("blue",[34,39],"color"),l("magenta",[35,39],"color"),l("cyan",[36,39],"color"),l("white",[37,39],"color"),l("gray",[90,39],"color"),l("grey",[90,39],"color"),l("bgBlack",[40,49],"bg"),l("bgRed",[41,49],"bg"),l("bgGreen",[42,49],"bg"),l("bgYellow",[43,49],"bg"),l("bgBlue",[44,49],"bg"),l("bgMagenta",[45,49],"bg"),l("bgCyan",[46,49],"bg"),l("bgWhite",[47,49],"bg"),l("blackBright",[90,39],"bright"),l("redBright",[91,39],"bright"),l("greenBright",[92,39],"bright"),l("yellowBright",[93,39],"bright"),l("blueBright",[94,39],"bright"),l("magentaBright",[95,39],"bright"),l("cyanBright",[96,39],"bright"),l("whiteBright",[97,39],"bright"),l("bgBlackBright",[100,49],"bgBright"),l("bgRedBright",[101,49],"bgBright"),l("bgGreenBright",[102,49],"bgBright"),l("bgYellowBright",[103,49],"bgBright"),l("bgBlueBright",[104,49],"bgBright"),l("bgMagentaBright",[105,49],"bgBright"),l("bgCyanBright",[106,49],"bgBright"),l("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=r,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,n)=>{let r="string"==typeof n?e[n]:n;if("function"!=typeof r)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");r.stack||(Reflect.defineProperty(r,"name",{value:t}),e.styles[t]=r,r.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(n){e.alias(t,n)},get(){let t=e=>i(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(r.stack):r.stack,t}})},e.theme=t=>{if(null===(n=t)||"object"!=typeof n||Array.isArray(n))throw new TypeError("Expected theme to be an object");var n;for(let n of Object.keys(t))e.alias(n,t[n]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=n(4),e.define=l,e};e.exports=o(),e.exports.create=o}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const n="Hyper"===t.env.TERM_PROGRAM,r="win32"===t.platform,o="linux"===t.platform,i={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},i,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},i,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",question:"?",questionFull:"?",questionSmall:"﹖",pointer:o?"▸":"❯",pointerSmall:o?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=r&&!n?l:a,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:i}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:a})}).call(this,n(0))}]); | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var u,c=[],s=!1,f=-1;function h(){s&&u&&(s=!1,u.length?c=u.concat(c):f=-1,c.length&&g())}function g(){if(!s){var e=a(h);s=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||s||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(2));window.Logger=o.default,window.initConsole=function(){window.console=new o.default("Console")}},function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&c(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var h=f(n(3)),g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Logger";a(this,e),this.prefix=t,this.memory=console.memory,this.Console=console.Console,this.queue=[],this.blocked=!1,this.countCount={},this.timeCount={},e.loggers.push(this),"undefined"!=typeof InstallTrigger&&(h.default.enabled=!1)}var t,n,i;return t=e,i=[{key:"isBlocked",value:function(e){var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}(this.loggers);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.blocked=e,e||r.processQueue()}}catch(e){n.e(e)}finally{n.f()}}},{key:"forceTheme",value:function(e){this.theme=e}}],(n=[{key:"assert",value:function(e){if(!e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.error.apply(this,["Assertion failed:"].concat(n))}}},{key:"clear",value:function(){console.clear()}},{key:"count",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";Object.prototype.hasOwnProperty.call(this.countCount,e)||(this.countCount[e]=0),this.log("".concat(e,":"),++this.countCount[e])}},{key:"countReset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";delete this.countCount[e]}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("debug",t)}},{key:"dir",value:function(e,t){if("object"!==l(e))return this.log(e);this.log("Method not fully implemented"),"undefined"==typeof window?console.dir(e,t):console.dir(e)}},{key:"dirxml",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("dirxml",t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("error",t)}},{key:"exception",value:function(){this.error.apply(this,arguments)}},{key:"group",value:function(){var e;(e=console).group.apply(e,arguments)}},{key:"groupCollapsed",value:function(){this.group.apply(this,arguments)}},{key:"groupEnd",value:function(){console.groupEnd()}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("info",t)}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("log",t)}},{key:"profile",value:function(e){if(!console.profile)throw new Error("profile don't exist in the current contexte");console.profile(e)}},{key:"profileEnd",value:function(e){console.profileEnd(e)}},{key:"table",value:function(e,t){console.table(e,t)}},{key:"time",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";Object.prototype.hasOwnProperty.call(this.timeCount,e)?this.warn("Timer '".concat(e,"' already exists.")):this.timeCount[e]=new Date}},{key:"timeEnd",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=(new Date).getTime()-this.timeCount[e].getTime();this.log("".concat(e,": ").concat(t,"ms - Timer ended")),delete this.timeCount[e]}},{key:"timeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";if(this.timeCount[e]){for(var t=(new Date).getTime()-this.timeCount[e].getTime(),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.log.apply(this,["".concat(e,": ").concat(t,"ms")].concat(r))}else this.warn("Timer '".concat(e,"' does not exist"))}},{key:"timeStamp",value:function(e){console.timeStamp(e)}},{key:"trace",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("trace",t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.process("warn",t)}},{key:"urgent",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,r(this.formatMessage(n)))}},{key:"process",value:function(e,t){this.queue.push({type:e,msg:this.formatMessage(t)}),this.processQueue()}},{key:"formatMessage",value:function(t){var n=this.prefix,r=n.length;e.prefixLen<r&&(e.prefixLen=r);var o=["",""];if(e.prefixLen>r){var i=e.prefixLen-r,a=i/2;o[0]=this.buildSpace(a-(i%2!=0?1:0)),o[1]=this.buildSpace(a)}return["".concat(this.blackOrWhite("[ ")).concat(o[0]).concat(h.blue(n)).concat(o[1]).concat(this.blackOrWhite(" ]"),":")].concat(t.map((function(e){return"object"===l(e)?e:void 0===e?h.yellow("undefined"):null===e?h.yellow("null"):"string"!=typeof e?h.yellow(e.toString()):h.green(e)})))}},{key:"processQueue",value:function(){for(;this.queue.length>0&&!this.blocked;){var e,t=this.queue.shift();t&&("trace"===t.type&&console.log(t.msg.shift()),(e=console)[t.type].apply(e,r(t.msg)))}}},{key:"buildSpace",value:function(e){return"".padStart(e," ")}},{key:"blackOrWhite",value:function(t){return!e.theme&&"undefined"!=typeof window||"light"===e.theme?h.black(t):h.white(t)}}])&&u(t.prototype,n),i&&u(t,i),e}();t.default=g,g.prefixLen=0,g.theme=void 0,g.loggers=[],t.logger=new g},function(e,t,n){"use strict";(function(t){const r=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{const e={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in t.env&&(e.enabled="0"!==t.env.FORCE_COLOR);const o=(e,t,n)=>"function"==typeof e?e(t):e.wrap(t,n),i=(t,n)=>{if(""===t||null==t)return"";if(!1===e.enabled)return t;if(!1===e.visible)return"";let r=""+t,i=r.includes("\n"),l=n.length;for(l>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());l-- >0;)r=o(e.styles[n[l]],r,i);return r},l=(t,n,r)=>{e.styles[t]=(e=>{let t=e.open=`[${e.codes[0]}m`,n=e.close=`[${e.codes[1]}m`,r=e.regex=new RegExp(`\\u001b\\[${e.codes[1]}m`,"g");return e.wrap=(e,o)=>{e.includes(n)&&(e=e.replace(r,n+t));let i=t+e+n;return o?i.replace(/\r*\n/g,`${n}$&${t}`):i},e})({name:t,codes:n}),(e.keys[r]||(e.keys[r]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(n){e.alias(t,n)},get(){let n=e=>i(e,n.stack);return Reflect.setPrototypeOf(n,e),n.stack=this.stack?this.stack.concat(t):[t],n}})};return l("reset",[0,0],"modifier"),l("bold",[1,22],"modifier"),l("dim",[2,22],"modifier"),l("italic",[3,23],"modifier"),l("underline",[4,24],"modifier"),l("inverse",[7,27],"modifier"),l("hidden",[8,28],"modifier"),l("strikethrough",[9,29],"modifier"),l("black",[30,39],"color"),l("red",[31,39],"color"),l("green",[32,39],"color"),l("yellow",[33,39],"color"),l("blue",[34,39],"color"),l("magenta",[35,39],"color"),l("cyan",[36,39],"color"),l("white",[37,39],"color"),l("gray",[90,39],"color"),l("grey",[90,39],"color"),l("bgBlack",[40,49],"bg"),l("bgRed",[41,49],"bg"),l("bgGreen",[42,49],"bg"),l("bgYellow",[43,49],"bg"),l("bgBlue",[44,49],"bg"),l("bgMagenta",[45,49],"bg"),l("bgCyan",[46,49],"bg"),l("bgWhite",[47,49],"bg"),l("blackBright",[90,39],"bright"),l("redBright",[91,39],"bright"),l("greenBright",[92,39],"bright"),l("yellowBright",[93,39],"bright"),l("blueBright",[94,39],"bright"),l("magentaBright",[95,39],"bright"),l("cyanBright",[96,39],"bright"),l("whiteBright",[97,39],"bright"),l("bgBlackBright",[100,49],"bgBright"),l("bgRedBright",[101,49],"bgBright"),l("bgGreenBright",[102,49],"bgBright"),l("bgYellowBright",[103,49],"bgBright"),l("bgBlueBright",[104,49],"bgBright"),l("bgMagentaBright",[105,49],"bgBright"),l("bgCyanBright",[106,49],"bgBright"),l("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=r,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,n)=>{let r="string"==typeof n?e[n]:n;if("function"!=typeof r)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");r.stack||(Reflect.defineProperty(r,"name",{value:t}),e.styles[t]=r,r.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(n){e.alias(t,n)},get(){let t=e=>i(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(r.stack):r.stack,t}})},e.theme=t=>{if(null===(n=t)||"object"!=typeof n||Array.isArray(n))throw new TypeError("Expected theme to be an object");var n;for(let n of Object.keys(t))e.alias(n,t[n]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=n(4),e.define=l,e};e.exports=o(),e.exports.create=o}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const n="Hyper"===t.env.TERM_PROGRAM,r="win32"===t.platform,o="linux"===t.platform,i={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},i,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},i,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",question:"?",questionFull:"?",questionSmall:"﹖",pointer:o?"▸":"❯",pointerSmall:o?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=r&&!n?l:a,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:i}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:a})}).call(this,n(0))}]); |
@@ -366,7 +366,3 @@ "use strict"; | ||
buildSpace(count) { | ||
let str = ''; | ||
for (let i = 0; i < count; i++) { | ||
str += ' '; | ||
} | ||
return str; | ||
return ''.padStart(count, ' '); | ||
} | ||
@@ -373,0 +369,0 @@ /** |
{ | ||
"name": "@dzeio/logger", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "My Personnal Logger", | ||
@@ -35,3 +35,3 @@ "repository": { | ||
}, | ||
"gitHead": "bc02559a5b98398d6643bc4a54fcf911896ef328" | ||
"gitHead": "066908cb4b6ced7a3b177d820aa8ea65a3f8306b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35427
650