UNPKG

chimee-helper-log

Version:
2 lines (1 loc) 3.29 kB
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(t.chimeeHelperLog={})}(this,function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,o){return t(o={exports:{}},o.exports),o.exports}n(function(o){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?o.exports=n=function(t){return e(t)}:o.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(t)}o.exports=n});var c="object"==typeof o&&o&&o.Object===Object&&o,r="object"==typeof self&&self&&self.Object===Object&&self,i=(c||r||Function("return this")()).Symbol,l=Object.prototype,f=l.hasOwnProperty,u=l.toString,s=i?i.toStringTag:void 0;var p=function(t){var o=f.call(t,s),e=t[s];try{t[s]=void 0}catch(t){}var n=u.call(t);return o?t[s]=e:delete t[s],n},y=Object.prototype.toString;var b=function(t){return y.call(t)},a=i?i.toStringTag:void 0;var m=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?p(t):b(t)};var d=function(t){return null!=t&&"object"==typeof t},h=n(function(t,o){var e=o&&!o.nodeType&&o,n=e&&t&&!t.nodeType&&t,r=n&&n.exports===e&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(t){}}();t.exports=i}),E=(h&&h.isRegExp,Function.prototype.toString.call(Object),h&&h.isDate,Array.isArray);var g=function(t){return"string"==typeof t||!E(t)&&d(t)&&"[object String]"==m(t)},A="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),L=function(){function t(){this.GLOBAL_TAG="chimee",this.FORCE_GLOBAL_TAG=!1,this.ENABLE_ERROR=!0,this.ENABLE_INFO=!0,this.ENABLE_WARN=!0,this.ENABLE_DEBUG=!0,this.ENABLE_VERBOSE=!0}return t.prototype.error=function(t,o){this.ENABLE_ERROR&&(console.error||console.warn||console.log).call(console,this.formatter(t,o))},t.prototype.info=function(t,o){this.ENABLE_INFO&&(console.info||console.log).call(console,this.formatter(t,o))},t.prototype.warn=function(t,o){this.ENABLE_WARN&&(console.warn||console.log).call(console,this.formatter(t,o))},t.prototype.debug=function(t,o){this.ENABLE_DEBUG&&(console.debug||console.log).call(console,this.formatter(t,o))},t.prototype.verbose=function(t,o){this.ENABLE_VERBOSE&&console.log(this.formatter(t,o))},t.prototype.formatter=function(t,o){if(!g(t))throw new TypeError("Log's method only acccept string as argument, but not "+t+" in "+e(t));return g(o)?"["+(t=this.FORCE_GLOBAL_TAG?this.GLOBAL_TAG:t||this.GLOBAL_TAG)+"] > "+o:"["+this.GLOBAL_TAG+"] > "+t},t}(),O=A&&window._chimee_log||new L;t.ChimeeHelperLog=L,t.chimeeLog=O,Object.defineProperty(t,"__esModule",{value:!0})});