File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/im/install/js/im/lib/logger/dist/logger.bundle.js.map
Back
{"version":3,"file":"logger.bundle.js","sources":["../src/logger.js"],"sourcesContent":["/**\n * Bitrix Messenger\n * Logger class\n *\n * @package bitrix\n * @subpackage im\n * @copyright 2001-2019 Bitrix\n */\n\nclass Logger\n{\n\t#types = {};\n\t#config = {};\n\t#custom = {};\n\n\tconstructor()\n\t{\n\t\tthis.#types = {\n\t\t\tdesktop: true,\n\t\t\tlog: false,\n\t\t\tinfo: false,\n\t\t\twarn: false,\n\t\t\terror: true,\n\t\t\ttrace: true,\n\t\t};\n\n\t\tthis.#config = this.#types;\n\n\t\tthis.__load();\n\t}\n\n\tsetConfig(types)\n\t{\n\t\tfor (let type in types)\n\t\t{\n\t\t\tif (\n\t\t\t\ttypes.hasOwnProperty(type)\n\t\t\t\t&& typeof this.#types[type] !== 'undefined'\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.#types[type] = !!types[type];\n\t\t\t\tthis.#config[type] = !!types[type];\n\t\t\t}\n\t\t}\n\n\t\tthis.__load();\n\t}\n\n\tenable(type)\n\t{\n\t\tif (typeof this.#types[type] === 'undefined')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.#types[type] = true;\n\t\tthis.#custom[type] = true;\n\n\t\tthis.__save();\n\n\t\treturn true;\n\t}\n\n\tdisable(type)\n\t{\n\t\tif (typeof this.#types[type] === 'undefined')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.#types[type] = false;\n\t\tthis.#custom[type] = false;\n\n\t\tthis.__save();\n\n\t\treturn true;\n\t}\n\n\tisEnabled(type)\n\t{\n\t\treturn this.#types[type] === true;\n\t}\n\n\tdesktop(...params)\n\t{\n\t\tif (this.isEnabled('desktop'))\n\t\t{\n\t\t\tconsole.log(...[...this.__getStyles('desktop'), ...params]);\n\t\t}\n\t}\n\n\tlog(...params)\n\t{\n\t\tif (this.isEnabled('log'))\n\t\t{\n\t\t\tconsole.log(...[...this.__getStyles('log'), ...params]);\n\t\t}\n\t}\n\n\tinfo(...params)\n\t{\n\t\tif (this.isEnabled('info'))\n\t\t{\n\t\t\tconsole.info(...[...this.__getStyles('info'), ...params]);\n\t\t}\n\t}\n\n\twarn(...params)\n\t{\n\t\tif (this.isEnabled('warn'))\n\t\t{\n\t\t\tconsole.warn(...[...this.__getStyles('warn'), ...params]);\n\t\t}\n\t}\n\n\terror(...params)\n\t{\n\t\tif (this.isEnabled('error'))\n\t\t{\n\t\t\tconsole.error(...[...this.__getStyles('error'), ...params]);\n\t\t}\n\t}\n\n\ttrace(...params)\n\t{\n\t\tif (this.isEnabled('trace'))\n\t\t{\n\t\t\tconsole.trace(...params);\n\t\t}\n\t}\n\n\t__save()\n\t{\n\t\tif (typeof window.localStorage !== 'undefined')\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlet custom = {};\n\t\t\t\tfor (let type in this.#custom)\n\t\t\t\t{\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.#custom.hasOwnProperty(type)\n\t\t\t\t\t\t&& this.#config[type] !== this.#custom[type]\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\tcustom[type] = !!this.#custom[type];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconsole.warn(JSON.stringify(custom));\n\n\t\t\t\twindow.localStorage.setItem('bx-messenger-logger', JSON.stringify(custom));\n\t\t\t}\n\t\t\tcatch(e) {}\n\t\t}\n\t}\n\n\t__load()\n\t{\n\t\tif (typeof window.localStorage !== 'undefined')\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlet custom = window.localStorage.getItem('bx-messenger-logger');\n\t\t\t\tif (typeof custom === 'string')\n\t\t\t\t{\n\t\t\t\t\tthis.#custom = JSON.parse(custom);\n\t\t\t\t\tthis.#types = {...this.#types, ...this.#custom};\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(e) {}\n\t\t}\n\t}\n\n\t__getStyles(type = 'all')\n\t{\n\t\tconst styles = {\n\t\t\t'desktop': [\"%cDESKTOP\", \"color: white; font-style: italic; background-color: #29619b; padding: 0 6\\px\"],\n\t\t\t'log': [\"%cLOG\", \"color: #2a323b; font-style: italic; background-color: #ccc; padding: 0 6\\px\"],\n\t\t\t'info': [\"%cINFO\", \"color: #fff; font-style: italic; background-color: #6b7f96; padding: 0 6\\px\"],\n\t\t\t'warn': [\"%cWARNING\", \"color: white; font-style: italic; padding: 0 6\\px; border: 1px solid #f0a74f\"],\n\t\t\t'error': [\"%cERROR\", \"color: white; font-style: italic; padding: 0 6\\px; border: 1px solid #8a3232\"],\n\t\t};\n\n\t\tif (type === 'all')\n\t\t{\n\t\t\treturn styles;\n\t\t}\n\n\t\tif (styles[type])\n\t\t{\n\t\t\treturn styles[type];\n\t\t}\n\n\t\treturn [];\n\t}\n\n\t__getRemoveString()\n\t{\n\t\tconst styles = this.__getStyles();\n\t\tconst result = [];\n\t\tfor (let type in styles)\n\t\t{\n\t\t\tif (styles.hasOwnProperty(type))\n\t\t\t{\n\t\t\t\tresult.push(styles[type][1]);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\nlet logger = new Logger();\n\nexport {logger as Logger};"],"names":["Logger","desktop","log","info","warn","error","trace","__load","types","type","hasOwnProperty","__save","isEnabled","params","console","__getStyles","window","localStorage","custom","JSON","stringify","setItem","e","getItem","parse","styles","result","push","logger"],"mappings":";;;;;;;;;;;;;;;;;;;CAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;KAEMA;CAML,oBACA;CAAA;;CAAA;CAAA;CAAA,aALS;CAKT;;CAAA;CAAA;CAAA,aAJU;CAIV;;CAAA;CAAA;CAAA,aAHU;CAGV;;CACC,oDAAc;CACbC,MAAAA,OAAO,EAAE,IADI;CAEbC,MAAAA,GAAG,EAAE,KAFQ;CAGbC,MAAAA,IAAI,EAAE,KAHO;CAIbC,MAAAA,IAAI,EAAE,KAJO;CAKbC,MAAAA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