{"version":3,"sources":["webpack://pnp.logging/webpack/universalModuleDefinition","webpack://pnp.logging/webpack/bootstrap","webpack://pnp.logging/./build/packages-es5/logging/src/logger.js","webpack://pnp.logging/./build/packages-es5/logging/src/loglevel.js","webpack://pnp.logging/./build/packages-es5/logging/src/listeners.js","webpack://pnp.logging/./build/packages-es5/logging/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","LogLevel","Logger","instance","activeLogLevel","set","configurable","undefined","_instance","LoggerImpl","subscribe","listeners","_i","arguments","length","map","listener","clearSubscribers","count","write","message","level","log","writeJSON","json","this","JSON","stringify","entry","error","err","data","subscribers","push","slice","subscriber","ConsoleListener","msg","format","console","warn","e","join","FunctionListener","method","__webpack_exports__"],"mappings":";;;;;;;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,eAAAD,IAEAD,EAAA,eAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBA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AAqB,GAAAH,KAAArB,gBAAAwB,EAAAP,OACAI,KAAAO,YAAAjB,IAAA,SAAAoB,GAAwD,OAAAA,EAAAb,IAAAM,MAGxDnB,EA/BA,IC7FA,SAAAR,GACAA,IAAA,qBACAA,IAAA,eACAA,IAAA,qBACAA,IAAA,iBACAA,IAAA,cALA,CAMCA,WCND,IAAAmC,EAAA,WACA,SAAAA,KAwCA,OAjCAA,EAAAvC,UAAAyB,IAAA,SAAAM,GACA,IAAAS,EAAAZ,KAAAa,OAAAV,GACA,OAAAA,EAAAP,OACA,OACA,OACAkB,QAAAjB,IAAAe,GACA,MACA,OACAE,QAAAC,KAAAH,GACA,MACA,OACAE,QAAAV,MAAAQ,KASAD,EAAAvC,UAAAyC,OAAA,SAAAV,GACA,IAAAS,KAEA,GADAA,EAAAJ,KAAA,YAAAL,EAAAR,cACAb,IAAAqB,EAAAG,KACA,IACAM,EAAAJ,KAAA,UAAAP,KAAAC,UAAAC,EAAAG,OAEA,MAAAU,GACAJ,EAAAJ,KAAA,8CAAAQ,GAGA,OAAAJ,EAAAK,KAAA,KAEAN,EAzCA,GAgDAO,EAAA,WAOA,SAAAA,EAAAC,GACAnB,KAAAmB,SAUA,OAHAD,EAAA9C,UAAAyB,IAAA,SAAAM,GACAH,KAAAmB,OAAAhB,IAEAe,EAlBA,GCpDA5E,EAAAQ,EAAAsE,EAAA,2BAAA3C,IAAAnC,EAAAQ,EAAAsE,EAAA,6BAAA5C,IAAAlC,EAAAQ,EAAAsE,EAAA,oCAAAT,IAAArE,EAAAQ,EAAAsE,EAAA,qCAAAF","file":"logging.es5.umd.bundle.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pnp.logging\"] = factory();\n\telse\n\t\troot[\"pnp.logging\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\r\n * Class used to subscribe ILogListener and log messages throughout an application\r\n *\r\n */\r\nvar Logger = /** @class */ (function () {\r\n function Logger() {\r\n }\r\n Object.defineProperty(Logger, \"activeLogLevel\", {\r\n /**\r\n * Gets or sets the active log level to apply for log filtering\r\n */\r\n get: function () {\r\n return Logger.instance.activeLogLevel;\r\n },\r\n set: function (value) {\r\n Logger.instance.activeLogLevel = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger, \"instance\", {\r\n get: function () {\r\n if (Logger._instance === undefined || Logger._instance === null) {\r\n Logger._instance = new LoggerImpl();\r\n }\r\n return Logger._instance;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds ILogListener instances to the set of subscribed listeners\r\n *\r\n * @param listeners One or more listeners to subscribe to this log\r\n */\r\n Logger.subscribe = function () {\r\n var listeners = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n listeners[_i] = arguments[_i];\r\n }\r\n listeners.map(function (listener) { return Logger.instance.subscribe(listener); });\r\n };\r\n /**\r\n * Clears the subscribers collection, returning the collection before modifiction\r\n */\r\n Logger.clearSubscribers = function () {\r\n return Logger.instance.clearSubscribers();\r\n };\r\n Object.defineProperty(Logger, \"count\", {\r\n /**\r\n * Gets the current subscriber count\r\n */\r\n get: function () {\r\n return Logger.instance.count;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Writes the supplied string to the subscribed listeners\r\n *\r\n * @param message The message to write\r\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Info)\r\n */\r\n Logger.write = function (message, level) {\r\n if (level === void 0) { level = 1 /* Info */; }\r\n Logger.instance.log({ level: level, message: message });\r\n };\r\n /**\r\n * Writes the supplied string to the subscribed listeners\r\n *\r\n * @param json The json object to stringify and write\r\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Info)\r\n */\r\n Logger.writeJSON = function (json, level) {\r\n if (level === void 0) { level = 1 /* Info */; }\r\n this.write(JSON.stringify(json), level);\r\n };\r\n /**\r\n * Logs the supplied entry to the subscribed listeners\r\n *\r\n * @param entry The message to log\r\n */\r\n Logger.log = function (entry) {\r\n Logger.instance.log(entry);\r\n };\r\n /**\r\n * Logs an error object to the subscribed listeners\r\n *\r\n * @param err The error object\r\n */\r\n Logger.error = function (err) {\r\n Logger.instance.log({ data: err, level: 3 /* Error */, message: err.message });\r\n };\r\n return Logger;\r\n}());\r\nexport { Logger };\r\nvar LoggerImpl = /** @class */ (function () {\r\n function LoggerImpl(activeLogLevel, subscribers) {\r\n if (activeLogLevel === void 0) { activeLogLevel = 2 /* Warning */; }\r\n if (subscribers === void 0) { subscribers = []; }\r\n this.activeLogLevel = activeLogLevel;\r\n this.subscribers = subscribers;\r\n }\r\n LoggerImpl.prototype.subscribe = function (listener) {\r\n this.subscribers.push(listener);\r\n };\r\n LoggerImpl.prototype.clearSubscribers = function () {\r\n var s = this.subscribers.slice(0);\r\n this.subscribers.length = 0;\r\n return s;\r\n };\r\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\r\n get: function () {\r\n return this.subscribers.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LoggerImpl.prototype.write = function (message, level) {\r\n if (level === void 0) { level = 1 /* Info */; }\r\n this.log({ level: level, message: message });\r\n };\r\n LoggerImpl.prototype.log = function (entry) {\r\n if (entry !== undefined && this.activeLogLevel <= entry.level) {\r\n this.subscribers.map(function (subscriber) { return subscriber.log(entry); });\r\n }\r\n };\r\n return LoggerImpl;\r\n}());\r\n//# sourceMappingURL=logger.js.map","/**\r\n * A set of logging levels\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\r\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\r\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\r\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\r\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\r\n})(LogLevel || (LogLevel = {}));\r\n//# sourceMappingURL=loglevel.js.map","/**\r\n * Implementation of LogListener which logs to the console\r\n *\r\n */\r\nvar ConsoleListener = /** @class */ (function () {\r\n function ConsoleListener() {\r\n }\r\n /**\r\n * Any associated data that a given logging listener may choose to log or ignore\r\n *\r\n * @param entry The information to be logged\r\n */\r\n ConsoleListener.prototype.log = function (entry) {\r\n var msg = this.format(entry);\r\n switch (entry.level) {\r\n case 0 /* Verbose */:\r\n case 1 /* Info */:\r\n console.log(msg);\r\n break;\r\n case 2 /* Warning */:\r\n console.warn(msg);\r\n break;\r\n case 3 /* Error */:\r\n console.error(msg);\r\n break;\r\n }\r\n };\r\n /**\r\n * Formats the message\r\n *\r\n * @param entry The information to format into a string\r\n */\r\n ConsoleListener.prototype.format = function (entry) {\r\n var msg = [];\r\n msg.push(\"Message: \" + entry.message);\r\n if (entry.data !== undefined) {\r\n try {\r\n msg.push(\" Data: \" + JSON.stringify(entry.data));\r\n }\r\n catch (e) {\r\n msg.push(\" Data: Error in stringify of supplied data \" + e);\r\n }\r\n }\r\n return msg.join(\"\");\r\n };\r\n return ConsoleListener;\r\n}());\r\nexport { ConsoleListener };\r\n/**\r\n * Implementation of LogListener which logs to the supplied function\r\n *\r\n */\r\nvar FunctionListener = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the FunctionListener class\r\n *\r\n * @constructor\r\n * @param method The method to which any logging data will be passed\r\n */\r\n function FunctionListener(method) {\r\n this.method = method;\r\n }\r\n /**\r\n * Any associated data that a given logging listener may choose to log or ignore\r\n *\r\n * @param entry The information to be logged\r\n */\r\n FunctionListener.prototype.log = function (entry) {\r\n this.method(entry);\r\n };\r\n return FunctionListener;\r\n}());\r\nexport { FunctionListener };\r\n//# sourceMappingURL=listeners.js.map","export * from \"./src/logging\";\r\n//# sourceMappingURL=index.js.map"],"sourceRoot":""}