standard-log 11.4.0 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/cjs/index.d.ts +2 -2
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +0 -1
- package/cjs/index.js.map +1 -1
- package/cjs/logger.d.ts.map +1 -1
- package/cjs/logger.js +4 -4
- package/cjs/logger.js.map +1 -1
- package/cjs/standardLog.ctx.d.ts +10 -0
- package/cjs/standardLog.ctx.d.ts.map +1 -0
- package/cjs/standardLog.ctx.js +6 -0
- package/cjs/standardLog.ctx.js.map +1 -0
- package/cjs/standardLog.d.ts +1 -15
- package/cjs/standardLog.d.ts.map +1 -1
- package/cjs/standardLog.js +14 -14
- package/cjs/standardLog.js.map +1 -1
- package/cjs/types.d.ts +9 -2
- package/cjs/types.d.ts.map +1 -1
- package/cjs/types.js.map +1 -1
- package/dist/standard-log.es5.js +201 -269
- package/dist/standard-log.es5.js.gz +0 -0
- package/dist/standard-log.es5.js.map +1 -1
- package/dist/standard-log.es5.js.map.gz +0 -0
- package/dist/standard-log.esm.js +200 -163
- package/dist/standard-log.esm.js.gz +0 -0
- package/dist/standard-log.esm.js.map +1 -1
- package/dist/standard-log.esm.js.map.gz +0 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +1 -1
- package/esm/logger.d.ts.map +1 -1
- package/esm/logger.js +4 -4
- package/esm/logger.js.map +1 -1
- package/esm/standardLog.ctx.d.ts +10 -0
- package/esm/standardLog.ctx.d.ts.map +1 -0
- package/esm/standardLog.ctx.js +3 -0
- package/esm/standardLog.ctx.js.map +1 -0
- package/esm/standardLog.d.ts +1 -15
- package/esm/standardLog.d.ts.map +1 -1
- package/esm/standardLog.js +1 -1
- package/esm/standardLog.js.map +1 -1
- package/esm/types.d.ts +9 -2
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js.map +1 -1
- package/package.json +3 -3
- package/ts/index.ts +7 -2
- package/ts/logger.ts +3 -4
- package/ts/standardLog.ctx.ts +8 -0
- package/ts/standardLog.ts +2 -14
- package/ts/types.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-log.esm.js","mappings":";;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACjKqC;AACY;AACP;AACF;AAGjC,SAAS,eAAe,CAAC,KAAa;IAC3C,QAAQ,IAAI,EAAE;QACZ,4CAA4C;QAC5C,KAAK,CAAC,KAAK,IAAI,CAAC,C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CAAC,QAAQ,EAAE;YACpB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ;SAC1C;QACD,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS;YACzC,SAAS,CAAC,MAAM,GAAG,CAAC;YACpB,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;SACrC;KACF;SACI;QACH,GAAG,CAAC,GAAG,GAAG,wBAAwB,CAAC,OAAO,CAAC;KAC5C;IACD,GAAG,CAAC,UAAU,GAAG,IAAI;AACvB,CAAC;;;;;;;;;;;;AClJY;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,qBAAqB;AACtF;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;;;;;;;;;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,oCAAoC,4BAA4B;AAChE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C,4CAA4C,6BAA6B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA,iBAAiB;AACjB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,YAAY,0BAA0B;AACtC;AACA;AACA,gEAAgE,6BAA6B;AAC7F;AACA;AACA,8DAA8D,oBAAoB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA,gBAAgB;AAChB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2EAA2E;AAC3G;AACA;AACA;AACA;AACA,yBAAyB,SAAS,GAAG,WAAW,KAAK,YAAY;AACjE;AACA;AACA,yBAAyB,SAAS,IAAI,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;AC5NO;AACP;AACA;AACA;;;;;;;;;;;;;;;ACHO;AACP;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACJO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;;;;;;;;;;;;;;;;;;ACPO;AACP;AACA,iBAAiB;AACjB,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B,KAAK;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;;;;;;UC3DA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN4B;AACD;AACG;AACA;AACH;AAIF;AAEC","sources":["webpack://StandardLog/../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","webpack://StandardLog/./ts/console.ts","webpack://StandardLog/./ts/errors.ts","webpack://StandardLog/./ts/formatter.ts","webpack://StandardLog/./ts/logLevels.ts","webpack://StandardLog/./ts/logStore.ts","webpack://StandardLog/./ts/logger.ts","webpack://StandardLog/./ts/memory.ts","webpack://StandardLog/./ts/platform.browser.ts","webpack://StandardLog/./ts/standardLog.ts","webpack://StandardLog/../../node_modules/.pnpm/upper-case@2.0.2/node_modules/upper-case/dist/index.js","webpack://StandardLog/../../node_modules/.pnpm/iso-error@4.4.0/node_modules/iso-error/esm/index.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/mapKey.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/record.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/reduceKey.js","webpack://StandardLog/../../node_modules/.pnpm/unpartial@1.0.4/node_modules/unpartial/esm/index.js","webpack://StandardLog/webpack/bootstrap","webpack://StandardLog/webpack/runtime/compat get default export","webpack://StandardLog/webpack/runtime/define property getters","webpack://StandardLog/webpack/runtime/hasOwnProperty shorthand","webpack://StandardLog/webpack/runtime/make namespace object","webpack://StandardLog/./ts/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","import { unpartial } from 'type-plus'\nimport { consoleFormatter } from './formatter.js'\nimport { logLevels } from './logLevels.js'\nimport { polyfill } from './platform.js'\nimport type { ConsoleLike, LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport function toConsoleMethod(level: number) {\n switch (true) {\n // edge case in case none is somehow written\n case (level <= 0): return 'debug'\n case (level <= logLevels.error): return 'error'\n case (level <= logLevels.warn): return 'warn'\n case (level <= logLevels.info): return 'info'\n default: return 'debug'\n }\n}\n\n// istanbul ignore next\n/* eslint-disable no-console */\nfunction buildPolyfillConsole() {\n // old phantomjs does not have bind function\n const hasBind = !!console.log.bind as boolean\n if (hasBind) {\n return {\n // the `typeof` guards against IE where `console.log.apply()`\n // results in error `Object doesn't support property or method 'apply'`\n debug: (typeof console.info === 'function' ? console.debug : console.log).bind(console),\n info: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n error: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n }\n }\n else {\n return {\n debug: buildFn(typeof console.debug === 'function' ? 'debug' : 'log'),\n info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),\n }\n }\n}\n\n// istanbul ignore next\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n return function (...args: any[]) { console[name](...args) }\n}\n\n\nexport type ConsoleLogFormatter = LogFormatter<any[]>\nexport type ConsoleLogReporter = LogReporter<any[]> & { console: ConsoleLike }\nexport type ConsoleLogReporterOptions = LogReporterOptions<any[]>\n\nexport function createConsoleLogReporter(options?: ConsoleLogReporterOptions): ConsoleLogReporter {\n const { id, formatter, filter } = unpartial({ id: 'console', formatter: consoleFormatter }, options)\n if (!polyfill.console) polyfill.console = buildPolyfillConsole()\n\n return Object.freeze({\n id,\n isConsoleReporter: true,\n get formatter() { return formatter },\n get filter() { return filter },\n console: polyfill.console,\n write(entry: LogEntry) {\n if (filter && !filter(entry)) return\n const values = formatter(entry)\n const method = toConsoleMethod(entry.level)\n this.console[method](...values)\n }\n })\n}\n","import { IsoError, ModuleError } from 'iso-error'\n\n/**\n * @deprecated No longer used since 11.2.0\n */\nexport class StandardLogError extends ModuleError {\n constructor(description: string, options?: IsoError.Options) {\n super('standard-log', description, options)\n }\n}\n\n/**\n * @deprecated no longer used since 11.2.0\n */\nexport class InvalidId extends StandardLogError {\n constructor(public id: string, options?: IsoError.Options) {\n super(`logger id only supports alphanumeric, unicode characters, and [:_-.]. Received ${id}`, options)\n }\n}\n","import ms from 'ms'\nimport { upperCase } from 'upper-case'\nimport { toLogLevelName } from './logLevels.js'\nimport type { LogEntry } from './types.js'\n\nexport type TimestampFormat = 'none' | 'iso' | 'elapsed'\n\nexport function createTimestampFormatter(format: TimestampFormat): (timestamp: Date) => string | undefined {\n switch (format) {\n case 'none':\n return (_timestamp: Date) => undefined\n case 'iso':\n return (timestamp: Date) => timestamp.toISOString()\n case 'elapsed': {\n let lastTick: number\n return (timestamp: Date) => {\n const newTick = timestamp.getTime()\n const result = ms(lastTick === undefined ? 0 : newTick - lastTick)\n lastTick = newTick\n return result\n }\n }\n }\n}\n\nexport function formatLogLevel(level: number) {\n return `(${upperCase(toLogLevelName(level))})`\n}\n\n/**\n * Formats log entry as plain text with the following format:\n * `timestamp id level ...args`\n *\n * This is typically useful for writing logs to file\n */\nexport function plainLogFormatter({ id, level, args, timestamp }: LogEntry) {\n return [timestamp.toISOString(), id, formatLogLevel(level), ...args]\n}\n\n/**\n * Formats log entry like default console log.\n */\nexport function consoleFormatter({ args }: LogEntry) {\n return args\n}\n","\nexport const logLevels = {\n /**\n * none: 0\n */\n none: 0 as const,\n /**\n * emergency: 100\n *\n * emergency -> alert\n */\n emergency: 100 as const,\n /**\n * alert: 200\n *\n * emergency -> alert -> critical\n */\n alert: 200 as const,\n /**\n * critical: 300\n *\n * alert -> critical -> error\n */\n critical: 300 as const,\n /**\n * error: 400\n *\n * critical -> error -> warn\n */\n error: 400 as const,\n /**\n * warn: 500\n *\n * error -> warn -> notice\n */\n warn: 500 as const,\n /**\n * notice: 600\n *\n * warn -> notice -> info\n */\n notice: 600 as const,\n /**\n * info: 700\n *\n * notice -> info -> debug\n */\n info: 700 as const,\n /**\n * debug: 800\n *\n * info -> debug -> trace\n */\n debug: 800 as const,\n /**\n * trace: 900\n *\n * debug -> trace -> planck\n */\n trace: 900 as const,\n /**\n * planck: Infinity\n * `planck unit` is a very small unit <https://en.wikipedia.org/wiki/Planck_units>.\n *\n * trace -> planck\n */\n planck: Infinity,\n /**\n * all: Infinity\n */\n all: Infinity\n}\n\n/**\n * Convert default log level value to log level name.\n */\nexport function toLogLevelName(level: number) {\n if (level <= 100) return 'emergency'\n if (level <= 200) return 'alert'\n if (level <= 300) return 'critical'\n if (level <= 400) return 'error'\n if (level <= 500) return 'warn'\n if (level <= 600) return 'notice'\n if (level <= 700) return 'info'\n if (level <= 800) return 'debug'\n if (level <= 900) return 'trace'\n return 'planck'\n}\n\n/**\n * Convert default log level name to log level value.\n */\nexport function toLogLevel(name: string): number | undefined {\n return (logLevels as any)[name.toLocaleLowerCase()]\n}\n\nexport const DEFAULT_LOG_METHOD_NAMES: string[] = [\n 'emergency',\n 'alert',\n 'critical',\n 'error',\n 'warn',\n 'notice',\n 'info',\n 'debug',\n 'trace',\n 'planck'\n]\n","\nimport { mapKey, record, reduceByKey, reduceKey } from 'type-plus'\nimport { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './logLevels.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(options: Required<StandardLogOptions<N>>): LogStore {\n return {\n loggers: record(),\n nonConsoleLoggers: record(),\n reporters: options.reporters || [createConsoleLogReporter()],\n logLevel: options.logLevel,\n logLevelStore: logLevelStore(options)\n }\n}\n\nexport interface LogStore {\n loggers: Record<string, Logger>,\n nonConsoleLoggers: Record<string, Logger>,\n reporters: LogReporter[],\n logLevel: LogLevel,\n logLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n customLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n const customLevels = options.customLevels || record()\n\n const store = {\n customLevels,\n customLevelsReverse: reduceByKey(customLevels, (p, k) => {\n p[customLevels[k]] = k\n return p\n }, {} as Record<number, string>)\n }\n return {\n getName(level: number) {\n return store.customLevelsReverse[level] ?? toLogLevelName(level)\n },\n getLevel(name: string) {\n return store.customLevels[name] ?? toLogLevel(name)\n },\n getAllLevels() {\n return reduceKey(logLevels, (result, name) => {\n if (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n return result\n }, mapKey(store.customLevels, name => ({ name, level: store.customLevels[name] })))\n }\n }\n}\n","import { logLevels } from './logLevels.js'\nimport { LogStore } from './logStore.js'\nimport type { LogEntry, LogFunction, Logger, LoggerOptions, LogMethodNames, LogReporter } from './types.js'\nimport { LogLevel } from './types.js'\n\nexport function createLogger<N extends string = LogMethodNames>(\n store: LogStore, id: string, options?: LoggerOptions\n): Logger<N | LogMethodNames> {\n id = sanitizeId(id)\n const writeTo = options?.writeTo ?? (() => true)\n const [filter, reporters]: [(reporterId: string) => boolean, LogReporter[]] = typeof writeTo === 'string'\n ? [id => id === writeTo, store.reporters]\n : writeTo instanceof RegExp\n ? [id => writeTo.test(id), store.reporters]\n : typeof writeTo === 'function'\n ? [writeTo, store.reporters]\n : [() => true, [writeTo]]\n\n function write(entry: LogEntry) {\n writeToReporters(reporters, entry, filter)\n }\n\n const logger = {\n level: options?.level,\n write\n } as any\n\n Object.defineProperties(logger, {\n id: { value: id, writable: false },\n count: {\n writable: false,\n value: ((counter) => (...args: any[]) => {\n const level = logLevels.debug\n if (shouldLog(store, level, logger.level))\n write({\n id,\n level,\n args: [++counter, ...args],\n timestamp: new Date()\n })\n })(0)\n },\n on: {\n writable: false,\n value: (level: number | N | LogMethodNames, logFn: LogFunction) => {\n const logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level)! : level\n if (shouldLog(store, logLevel, logger.level)) {\n const methodName = store.logLevelStore.getName(logLevel)\n const bindedMethod = logger[methodName].bind(logger)\n const result = logFn(bindedMethod)\n if (result) bindedMethod(result)\n }\n }\n }\n })\n store.logLevelStore.getAllLevels().forEach(function addMethod({ name, level }) {\n Object.defineProperty(logger, name, {\n writable: false,\n value: (...args: any[]) => {\n if (shouldLog(store, level, logger.level)) write({ id, level, args, timestamp: new Date() })\n }\n })\n })\n return logger\n}\n\nfunction sanitizeId(id: string) {\n return id.replace(/[`~!#$%^&*()=+[\\]{},|<>?]/g, '-')\n}\n\nfunction writeToReporters(reporters: LogReporter[], logEntry: LogEntry, filter: (reporterId: string) => boolean) {\n reporters.filter(r => filter(r.id)).forEach(r => r.write(logEntry!))\n}\n\n/**\n * Determines should you log.\n * @param loggerLevel Log level of the logger.\n * It can be undefined which the global log level will be used.\n */\nfunction shouldLog(store: LogStore, targetLevel: LogLevel, loggerLevel: LogLevel | undefined) {\n return targetLevel <= (loggerLevel !== undefined ? loggerLevel : store.logLevel)\n}\n","import { required, unpartial } from 'type-plus'\nimport { toInspectLogEntry } from './platform.js'\nimport { formatLogLevel } from './formatter.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\nimport { createConsoleLogReporter } from './console.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n logs: LogEntry[],\n /**\n * Gets a simple log message for testing.\n * The message only contains arguments for each log entry.\n */\n getLogMessage(): string,\n getLogMessages(): string[],\n getLogMessageWithLevel(): string,\n getLogMessagesWithIdAndLevel(): string[],\n emit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n return logs.map(toInspectLogEntry)\n .map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n .join('\\n')\n // if it has more than this log,\n // we assume it is running under tests,\n // and remove this log to simplify testing.\n .replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n return Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n const { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n const logs: LogEntry[] = []\n return {\n id,\n get formatter() { return formatter },\n get filter() { return filter },\n logs,\n write(entry: LogEntry) {\n if (filter && !filter(entry)) return\n logs.push(formatter(entry))\n },\n getLogMessage() {\n return this.getLogMessages().join('\\n')\n },\n getLogMessages() {\n return logs.map(toInspectLogEntry)\n .map(log => log.args.join(' '))\n },\n getLogMessagesWithIdAndLevel() {\n return logs.map(toInspectLogEntry)\n .map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n },\n getLogMessageWithLevel() { return toMessageWithLevel(logs) },\n /**\n * emit the saved log to console for easy debugging\n */\n emit() {\n const reporter = createConsoleLogReporter()\n logs.forEach(l => reporter.write(l))\n }\n }\n}\n\nexport function createMemoryWithConsoleLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n return Object.freeze(\n Object.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n isConsoleReporter: true\n }))\n}\n","import { record } from 'type-plus'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => e\n\nexport const polyfill: { console?: ConsoleLike } = record()\n","import { record, required } from 'type-plus'\nimport { createLogger } from './logger.js'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './logLevels.js'\nimport { createLogStore, LogStore } from './logStore.js'\nimport { createMemoryLogReporter, MemoryLogReporter } from './memory.js'\nimport type { Logger, LoggerOptions, LogLevel, LogMethodNames, StandardLogOptions } from './types.js'\n\nexport interface StandardLogInstance<N extends string = LogMethodNames> {\n logLevel: number,\n toLogLevelName(level: number): string,\n toLogLevel(name: N): number,\n getLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>,\n getNonConsoleLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>\n}\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {\n}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): StandardLog<N> {\n const closure = createStandardLogClosure(options)\n if (options?.reporters?.some(r => !r.id)) {\n const log = closure.standardLog.getLogger('standard-log')\n log.critical(`Detected reporter with empty id. This is not allowed as it will create problems with feature like 'getNonConsoleLogger()'. Please add an id to your reporter.`)\n }\n\n if (!ctx.gsl) ctx.gsl = closure as any\n return closure.standardLog\n}\n\nfunction noop() { }\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): { store: LogStore, standardLog: StandardLog<N> } {\n // TODO reporter.id must not be empty\n const store = createLogStore(required({ logLevel: logLevels.info }, options))\n const nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n const logMethods = DEFAULT_LOG_METHOD_NAMES\n .concat(Object.keys(options?.customLevels ?? {}))\n .concat(['on', 'count', 'write'])\n return {\n store,\n standardLog: {\n get logLevel() { return store.logLevel },\n\n toLogLevelName(level: number) {\n return store.logLevelStore.getName(level)\n },\n toLogLevel(name: string) {\n return store.logLevelStore.getLevel(name)\n },\n getLogger(id: string, options?: LoggerOptions) {\n if (store.loggers[id]) return store.loggers[id] as any\n return store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any\n },\n getNonConsoleLogger(id, options?) {\n if (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n if (store.loggers[id]) {\n const log = this.getLogger('standard-log')\n log.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n return store.nonConsoleLoggers[id] = createDummyLogger(logMethods)\n }\n\n return store.nonConsoleLoggers[id] = nonConsoleReporters.length === 0\n ? createDummyLogger(logMethods)\n : createLogger(store, id, {\n ssf: this.getNonConsoleLogger,\n ...options,\n writeTo(reporterId) {\n return nonConsoleReporters.indexOf(reporterId) >= 0\n }\n })\n },\n }\n }\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n return logMethods.reduce((p, m) => {\n p[m] = noop\n return p\n }, record()) as Logger\n}\n\nexport type StandardLogForTest<N extends string = LogMethodNames> = StandardLog<N> & { reporter: MemoryLogReporter }\n\nexport function createStandardLogForTest<N extends string = LogMethodNames>(\n logLevel: LogLevel = logLevels.debug\n): StandardLogForTest<N> {\n const reporter = createMemoryLogReporter()\n const closure = createStandardLogClosure<N>({ reporters: [reporter], logLevel })\n return { ...closure.standardLog, reporter }\n}\n\n/**\n * Suppress logging within the code block.\n */\nexport function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R\nexport function suppressLogs<R>(block: () => R, ...logs: Logger[]): R {\n const origLevels = logs.map(l => l.level)\n logs.forEach(l => l.level = logLevels.none)\n const result = block()\n logs.forEach((l, i) => l.level = origLevels[i])\n return result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n return getGlobalSL<N>().getLogger(id, options)\n}\n\nexport const ctx: {\n configured?: boolean,\n gsl?: { store: LogStore, standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n if (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n return ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n if (ctx.configured) {\n const log = ctx.gsl!.standardLog.getLogger('standard-log')\n log.warn('configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.')\n }\n\n if (ctx.gsl) {\n if (options.logLevel) {\n ctx.gsl.store.logLevel = options.logLevel\n }\n if (options.reporters) {\n const reporters = ctx.gsl.store.reporters\n reporters.length = 0\n reporters.push(...options.reporters)\n }\n }\n else {\n ctx.gsl = createStandardLogClosure(options)\n }\n ctx.configured = true\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.upperCase = exports.localeUpperCase = void 0;\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n az: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n lt: {\n regexp: /[\\u0069\\u006A\\u012F]\\u0307|\\u0069\\u0307[\\u0300\\u0301\\u0303]/g,\n map: {\n i̇: \"\\u0049\",\n j̇: \"\\u004A\",\n į̇: \"\\u012E\",\n i̇̀: \"\\u00CC\",\n i̇́: \"\\u00CD\",\n i̇̃: \"\\u0128\",\n },\n },\n};\n/**\n * Localized upper case.\n */\nfunction localeUpperCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return upperCase(str);\n}\nexports.localeUpperCase = localeUpperCase;\n/**\n * Upper case as a function.\n */\nfunction upperCase(str) {\n return str.toUpperCase();\n}\nexports.upperCase = upperCase;\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/unbound-method */\n//#region captureStackTrace polyfill\n// istanbul ignore next\nif (!Error.captureStackTrace) {\n Error.captureStackTrace = function (error) {\n const container = new Error();\n Object.defineProperty(error, 'stack', {\n configurable: true,\n get: function () {\n // Replace property with value for faster future accesses.\n defineStack(this, container.stack);\n return container.stack;\n },\n set: function (stack) { defineStack(error, stack); },\n });\n };\n}\n// istanbul ignore next\nfunction defineStack(target, value) {\n Object.defineProperty(target, 'stack', {\n configurable: true,\n value,\n writable: true,\n });\n}\nconst serializers = [];\nconst deserializers = [];\n/**\n * Isomorphic Error that works across physical boundary.\n */\nexport class IsoError extends Error {\n constructor(message, options) {\n super(message);\n /**\n * Name of the error\n */\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Error cause\n */\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n //restore prototype chain\n const actualProto = new.target.prototype;\n this.name = actualProto.constructor.name;\n // istanbul ignore next\n if (Object.setPrototypeOf)\n Object.setPrototypeOf(this, actualProto);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n else\n this.__proto__ = actualProto;\n if (options?.cause)\n this.cause = toIsoError(options.cause);\n if (options?.ssf)\n Error.captureStackTrace(this, options.ssf);\n }\n /**\n * Create an IsoError with additional properties without the need to create a new class.\n * @param props properties of the IsoError\n */\n static create(props) {\n const { message, cause, ...rest } = props;\n const err = new IsoError(message, { cause, ssf: IsoError.create });\n return Object.assign(err, rest);\n }\n static stringify(err) {\n return this.serialize(err);\n }\n static serialize(err) {\n return JSON.stringify(this.toSerializable(err));\n }\n /**\n * @type P Additional properties of the IsoError\n * @param text Json representation of a IsoError\n */\n static parse(text) {\n return deserialize(IsoError.parse, text);\n }\n /**\n * @type P Additional properties of the IsoError\n * @param text Json representation of a IsoError\n */\n static deserialize(text) {\n return deserialize(IsoError.deserialize, text);\n }\n static toSerializable(err) {\n return serializers.reduce((p, s) => p || s(err), undefined)\n || toSerializableError(err);\n }\n static fromSerializable(json) {\n const err = deserializeError(json);\n Error.captureStackTrace(err, IsoError.fromSerializable);\n return err;\n }\n /**\n * returns the error message including the error causes.\n */\n static trace(err) {\n return trace(err);\n }\n static addPlugin({ toSerializable, fromSerializable }) {\n serializers.unshift(toSerializable);\n deserializers.unshift(fromSerializable);\n }\n toString() { return IsoError.serialize(this); }\n trace() { return IsoError.trace(this); }\n}\nfunction deserialize(fn, text) {\n const json = JSON.parse(text);\n const err = deserializeError(json);\n Error.captureStackTrace(err, fn);\n return err;\n}\nfunction deserializeError(json) {\n let err = undefined;\n for (const d of deserializers) {\n err = d(json);\n if (err)\n break;\n }\n return err || defaultDeserializeError(json);\n}\nfunction defaultDeserializeError(json) {\n if (json.name === 'AggregateError') {\n const { message, errors, ...rest } = json;\n // @ts-ignore\n if (global.AggregateError) {\n return Object.assign(new AggregateError(errors, message), rest);\n }\n else {\n return Object.assign(new Error(message), {\n ...rest,\n errors\n });\n }\n }\n const { message, cause, ...rest } = json;\n const causeError = cause ? deserializeError(cause) : undefined;\n if (json.name === 'Error') {\n return Object.assign(new Error(message), causeError ? { ...rest, cause: causeError } : rest);\n }\n // @ts-ignore\n return Object.assign(new IsoError(message, causeError ? { cause: causeError } : undefined), rest);\n}\nfunction toSerializableError(err) {\n if (isAggregateError(err)) {\n return {\n ...err, name: err.constructor.name, message: err.message,\n errors: err.errors.map(toSerializableError)\n };\n }\n if (err instanceof Error) {\n const { message, cause } = err;\n return cause\n ? { ...err, name: err.constructor.name, message, cause: toSerializableError(cause) }\n : { ...err, name: err.constructor.name, message };\n }\n return err;\n}\n// NOTE: In this function I have to to Object.assign to keep the err instance and its stack trace.\nfunction toIsoError(err) {\n if (err instanceof IsoError)\n return err;\n // When the error is an internal error from deserialzation,\n // the err.constructor.name is object\n return Object.assign(err, { name: err.constructor.name !== 'Object' ? err.constructor.name : err.name });\n}\nfunction trace(err) {\n const messages = [];\n if (err instanceof ModuleError) {\n messages.push(`${err.name}(${err.module}): ${err.message}`);\n }\n else if (err instanceof Error) {\n messages.push(`${err.name}: ${err.message}`);\n }\n if (isAggregateError(err)) {\n err.errors.forEach(e => messages.push(...trace(e).split('\\n').map(s => ' ' + s)));\n }\n if (err instanceof Error) {\n if (hasCause(err))\n messages.push(...trace(err.cause).split('\\n').map(s => ' ' + s));\n }\n else {\n messages.push(typeof err === 'string' ? err : JSON.stringify(err));\n }\n return messages.join('\\n');\n}\nfunction hasCause(x) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return !!x.cause;\n}\n/**\n * An IsoError with a module property.\n */\nexport class ModuleError extends IsoError {\n /**\n * @param module The module that defines this error.\n */\n constructor(module, message, options) {\n super(message, options);\n Object.defineProperty(this, \"module\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: module\n });\n }\n}\nexport function isAggregateError(error) {\n return error instanceof Error && Array.isArray(error.errors);\n}\n//# sourceMappingURL=index.js.map","export function mapKey(subject, predicate, thisArg) {\n return Object.keys(subject).map(predicate, thisArg);\n}\n//# sourceMappingURL=mapKey.js.map","export function record(value) {\n const r = Object.create(null);\n return (value ? Object.assign(r, value) : r);\n}\n//# sourceMappingURL=record.js.map","export function reduceByKey(subject, callbackfn, initialValue) {\n return Object.keys(subject).reduce(callbackfn, initialValue);\n}\n/**\n * @deprecated renamed to reduceByKey\n */\nexport const reduceKey = reduceByKey;\n//# sourceMappingURL=reduceKey.js.map","export function required(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => {\n return { ...p, ...e };\n });\n}\nexport function requiredDeep(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n if (entries[0] === undefined || entries[0] === null)\n return entries[0];\n return entries.filter(x => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n if (typeof source1 !== 'object' || source1 === null)\n return source2 !== undefined ? source2 : source1;\n if (Array.isArray(source1)) {\n if (Array.isArray(source2))\n return source2;\n if (source2 === undefined)\n return [...source1];\n return [...source1, source2];\n }\n return getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n // @ts-ignore\n p[k] = deepmerge(source1[k], source2 && source2[k]);\n return p;\n }, {});\n}\nfunction getAllKeys(subject, internal = false) {\n if (typeof subject !== 'object')\n return [];\n const propertyNames = Object.getOwnPropertyNames(subject);\n const keys = internal ? propertyNames.filter(n => n !== 'constructor') : propertyNames;\n const proto = Object.getPrototypeOf(subject);\n return proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nexport function unpartial(s1, s2, s3) {\n // defensive check for JS\n if (s1 === undefined || s1 === null)\n return s1;\n return [s1, s2, s3]\n .filter(notNil)\n .reduce((p, s) => ({ ...p, ...trimNilProps(s) }), {});\n}\nfunction trimNilProps(value) {\n return Object.keys(value).reduce((p, k) => {\n if (notNil(value[k]))\n p[k] = value[k];\n return p;\n }, {});\n}\nfunction notNil(value) {\n return value !== null && value !== undefined;\n}\nexport function unpartialRecursively(arg1, arg2, arg3) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return requiredDeep(arg1, arg2, arg3);\n}\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './console.js'\nexport * from './errors.js'\nexport * from './formatter.js'\nexport * from './logLevels.js'\nexport * from './memory.js'\nexport {\n configGlobal, createStandardLog, createStandardLogForTest,\n getLogger, suppressLogs\n} from './standardLog.js'\nexport type { StandardLog, StandardLogForTest, StandardLogInstance } from './standardLog.js'\nexport * from './types.js'\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"standard-log.esm.js","mappings":";;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACjKqC;AACY;AACP;AACF;AAGjC,SAAS,eAAe,CAAC,KAAa;IAC3C,QAAQ,IAAI,EAAE;QACZ,4CAA4C;QAC5C,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,OAAO;QACjC,KAAK,CAAC,KAAK,IAAI,0DAAe,CAAC,CAAC,CAAC,OAAO,OAAO;QAC/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,GAAG,CAAC;YACpB,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;SACrC;KACF;SACI;QACH,wDAAO,GAAG,wBAAwB,CAAC,OAAO,CAAC;KAC5C;IACD,+DAAc,GAAG,IAAI;AACvB,CAAC;;;;;;;;;;;;ACtIY;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,qBAAqB;AACtF;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;;;;;;;;;;;;;;;;;AChDA;AACA,8BAA8B,SAAI,IAAI,SAAI;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,oCAAoC,4BAA4B;AAChE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,YAAY,0BAA0B;AACtC;AACA;AACA,gEAAgE,6BAA6B;AAC7F;AACA;AACA,8DAA8D,oBAAoB;AAClF,CAAC;AACD;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA,gBAAgB;AAChB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C,4CAA4C,6BAA6B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qBAAqB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,2BAA2B;AAClF;AACA;AACA,uDAAuD,gCAAgC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS,GAAG,WAAW,KAAK,YAAY;AACrE;AACA;AACA,6BAA6B,SAAS,IAAI,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,cAAc;AACd;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,gCAAgC,2EAA2E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;AC/OO;AACP;AACA;AACA;;;;;;;;;;;;;;;ACHO;AACP;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACJO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;;;;;;;;;;;;;;;;;;ACPO;AACP;AACA,iBAAiB;AACjB,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B,KAAK;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;;;;;;UC3DA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN4B;AACD;AACG;AACA;AACH;AAIF","sources":["webpack://StandardLog/../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","webpack://StandardLog/./ts/console.ts","webpack://StandardLog/./ts/errors.ts","webpack://StandardLog/./ts/formatter.ts","webpack://StandardLog/./ts/logLevels.ts","webpack://StandardLog/./ts/logStore.ts","webpack://StandardLog/./ts/logger.ts","webpack://StandardLog/./ts/memory.ts","webpack://StandardLog/./ts/platform.browser.ts","webpack://StandardLog/./ts/standardLog.ctx.ts","webpack://StandardLog/./ts/standardLog.ts","webpack://StandardLog/../../node_modules/.pnpm/upper-case@2.0.2/node_modules/upper-case/dist/index.js","webpack://StandardLog/../../node_modules/.pnpm/iso-error@5.0.0/node_modules/iso-error/esm/index.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/mapKey.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/record.js","webpack://StandardLog/../../node_modules/.pnpm/type-plus@4.16.0/node_modules/type-plus/esm/object/reduceKey.js","webpack://StandardLog/../../node_modules/.pnpm/unpartial@1.0.4/node_modules/unpartial/esm/index.js","webpack://StandardLog/webpack/bootstrap","webpack://StandardLog/webpack/runtime/compat get default export","webpack://StandardLog/webpack/runtime/define property getters","webpack://StandardLog/webpack/runtime/hasOwnProperty shorthand","webpack://StandardLog/webpack/runtime/make namespace object","webpack://StandardLog/./ts/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","import { unpartial } from 'type-plus'\nimport { consoleFormatter } from './formatter.js'\nimport { logLevels } from './logLevels.js'\nimport { polyfill } from './platform.js'\nimport type { ConsoleLike, LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport function toConsoleMethod(level: number) {\n switch (true) {\n // edge case in case none is somehow written\n case (level <= 0): return 'debug'\n case (level <= logLevels.error): return 'error'\n case (level <= logLevels.warn): return 'warn'\n case (level <= logLevels.info): return 'info'\n default: return 'debug'\n }\n}\n\n// istanbul ignore next\n/* eslint-disable no-console */\nfunction buildPolyfillConsole() {\n // old phantomjs does not have bind function\n const hasBind = !!console.log.bind as boolean\n if (hasBind) {\n return {\n // the `typeof` guards against IE where `console.log.apply()`\n // results in error `Object doesn't support property or method 'apply'`\n debug: (typeof console.info === 'function' ? console.debug : console.log).bind(console),\n info: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n error: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n }\n }\n else {\n return {\n debug: buildFn(typeof console.debug === 'function' ? 'debug' : 'log'),\n info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),\n }\n }\n}\n\n// istanbul ignore next\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n return function (...args: any[]) { console[name](...args) }\n}\n\n\nexport type ConsoleLogFormatter = LogFormatter<any[]>\nexport type ConsoleLogReporter = LogReporter<any[]> & { console: ConsoleLike }\nexport type ConsoleLogReporterOptions = LogReporterOptions<any[]>\n\nexport function createConsoleLogReporter(options?: ConsoleLogReporterOptions): ConsoleLogReporter {\n const { id, formatter, filter } = unpartial({ id: 'console', formatter: consoleFormatter }, options)\n if (!polyfill.console) polyfill.console = buildPolyfillConsole()\n\n return Object.freeze({\n id,\n isConsoleReporter: true,\n get formatter() { return formatter },\n get filter() { return filter },\n console: polyfill.console,\n write(entry: LogEntry) {\n if (filter && !filter(entry)) return\n const values = formatter(entry)\n const method = toConsoleMethod(entry.level)\n this.console[method](...values)\n }\n })\n}\n","import { IsoError, ModuleError } from 'iso-error'\n\n/**\n * @deprecated No longer used since 11.2.0\n */\nexport class StandardLogError extends ModuleError {\n constructor(description: string, options?: IsoError.Options) {\n super('standard-log', description, options)\n }\n}\n\n/**\n * @deprecated no longer used since 11.2.0\n */\nexport class InvalidId extends StandardLogError {\n constructor(public id: string, options?: IsoError.Options) {\n super(`logger id only supports alphanumeric, unicode characters, and [:_-.]. Received ${id}`, options)\n }\n}\n","import ms from 'ms'\nimport { upperCase } from 'upper-case'\nimport { toLogLevelName } from './logLevels.js'\nimport type { LogEntry } from './types.js'\n\nexport type TimestampFormat = 'none' | 'iso' | 'elapsed'\n\nexport function createTimestampFormatter(format: TimestampFormat): (timestamp: Date) => string | undefined {\n switch (format) {\n case 'none':\n return (_timestamp: Date) => undefined\n case 'iso':\n return (timestamp: Date) => timestamp.toISOString()\n case 'elapsed': {\n let lastTick: number\n return (timestamp: Date) => {\n const newTick = timestamp.getTime()\n const result = ms(lastTick === undefined ? 0 : newTick - lastTick)\n lastTick = newTick\n return result\n }\n }\n }\n}\n\nexport function formatLogLevel(level: number) {\n return `(${upperCase(toLogLevelName(level))})`\n}\n\n/**\n * Formats log entry as plain text with the following format:\n * `timestamp id level ...args`\n *\n * This is typically useful for writing logs to file\n */\nexport function plainLogFormatter({ id, level, args, timestamp }: LogEntry) {\n return [timestamp.toISOString(), id, formatLogLevel(level), ...args]\n}\n\n/**\n * Formats log entry like default console log.\n */\nexport function consoleFormatter({ args }: LogEntry) {\n return args\n}\n","\nexport const logLevels = {\n /**\n * none: 0\n */\n none: 0 as const,\n /**\n * emergency: 100\n *\n * emergency -> alert\n */\n emergency: 100 as const,\n /**\n * alert: 200\n *\n * emergency -> alert -> critical\n */\n alert: 200 as const,\n /**\n * critical: 300\n *\n * alert -> critical -> error\n */\n critical: 300 as const,\n /**\n * error: 400\n *\n * critical -> error -> warn\n */\n error: 400 as const,\n /**\n * warn: 500\n *\n * error -> warn -> notice\n */\n warn: 500 as const,\n /**\n * notice: 600\n *\n * warn -> notice -> info\n */\n notice: 600 as const,\n /**\n * info: 700\n *\n * notice -> info -> debug\n */\n info: 700 as const,\n /**\n * debug: 800\n *\n * info -> debug -> trace\n */\n debug: 800 as const,\n /**\n * trace: 900\n *\n * debug -> trace -> planck\n */\n trace: 900 as const,\n /**\n * planck: Infinity\n * `planck unit` is a very small unit <https://en.wikipedia.org/wiki/Planck_units>.\n *\n * trace -> planck\n */\n planck: Infinity,\n /**\n * all: Infinity\n */\n all: Infinity\n}\n\n/**\n * Convert default log level value to log level name.\n */\nexport function toLogLevelName(level: number) {\n if (level <= 100) return 'emergency'\n if (level <= 200) return 'alert'\n if (level <= 300) return 'critical'\n if (level <= 400) return 'error'\n if (level <= 500) return 'warn'\n if (level <= 600) return 'notice'\n if (level <= 700) return 'info'\n if (level <= 800) return 'debug'\n if (level <= 900) return 'trace'\n return 'planck'\n}\n\n/**\n * Convert default log level name to log level value.\n */\nexport function toLogLevel(name: string): number | undefined {\n return (logLevels as any)[name.toLocaleLowerCase()]\n}\n\nexport const DEFAULT_LOG_METHOD_NAMES: string[] = [\n 'emergency',\n 'alert',\n 'critical',\n 'error',\n 'warn',\n 'notice',\n 'info',\n 'debug',\n 'trace',\n 'planck'\n]\n","\nimport { mapKey, record, reduceByKey, reduceKey } from 'type-plus'\nimport { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './logLevels.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(options: Required<StandardLogOptions<N>>): LogStore {\n return {\n loggers: record(),\n nonConsoleLoggers: record(),\n reporters: options.reporters || [createConsoleLogReporter()],\n logLevel: options.logLevel,\n logLevelStore: logLevelStore(options)\n }\n}\n\nexport interface LogStore {\n loggers: Record<string, Logger>,\n nonConsoleLoggers: Record<string, Logger>,\n reporters: LogReporter[],\n logLevel: LogLevel,\n logLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n customLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n const customLevels = options.customLevels || record()\n\n const store = {\n customLevels,\n customLevelsReverse: reduceByKey(customLevels, (p, k) => {\n p[customLevels[k]] = k\n return p\n }, {} as Record<number, string>)\n }\n return {\n getName(level: number) {\n return store.customLevelsReverse[level] ?? toLogLevelName(level)\n },\n getLevel(name: string) {\n return store.customLevels[name] ?? toLogLevel(name)\n },\n getAllLevels() {\n return reduceKey(logLevels, (result, name) => {\n if (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n return result\n }, mapKey(store.customLevels, name => ({ name, level: store.customLevels[name] })))\n }\n }\n}\n","import { logLevels } from './logLevels.js'\nimport { LogStore } from './logStore.js'\nimport type { LogEntry, LogFunction, Logger, LoggerOptions, LogMethodNames, LogReporter } from './types.js'\nimport { LogLevel } from './types.js'\n\nexport function createLogger<N extends string = LogMethodNames>(\n store: LogStore, id: string, options?: LoggerOptions\n): Logger<N | LogMethodNames> {\n id = sanitizeId(id)\n const writeTo = options?.writeTo ?? (() => true)\n const [filter, reporters]: [(reporterId: string) => boolean, LogReporter[]] = typeof writeTo === 'string'\n ? [id => id === writeTo, store.reporters]\n : writeTo instanceof RegExp\n ? [id => writeTo.test(id), store.reporters]\n : typeof writeTo === 'function'\n ? [writeTo, store.reporters]\n : [() => true, [writeTo]]\n\n function write(entry: LogEntry) {\n writeToReporters(reporters, entry, filter)\n }\n\n const logger = {\n level: options?.level,\n write\n } as any\n\n Object.defineProperties(logger, {\n id: { value: id, writable: false },\n count: {\n writable: false,\n value: ((counter) => (...args: any[]) => {\n if (shouldLog(store, logLevels.debug, logger.level))\n write({\n id,\n level: logLevels.debug,\n args: [++counter, ...args],\n timestamp: new Date()\n })\n })(0)\n },\n on: {\n writable: false,\n value: (level: number | N | LogMethodNames, logFn: LogFunction) => {\n const logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level)! : level\n if (shouldLog(store, logLevel, logger.level)) {\n const methodName = store.logLevelStore.getName(logLevel)\n const bindedMethod = logger[methodName].bind(logger)\n const result = logFn(bindedMethod, logger.level ?? store.logLevel)\n if (result) bindedMethod(result)\n }\n }\n }\n })\n store.logLevelStore.getAllLevels().forEach(function addMethod({ name, level }) {\n Object.defineProperty(logger, name, {\n writable: false,\n value: (...args: any[]) => {\n if (shouldLog(store, level, logger.level)) write({ id, level, args, timestamp: new Date() })\n }\n })\n })\n return logger\n}\n\nfunction sanitizeId(id: string) {\n return id.replace(/[`~!#$%^&*()=+[\\]{},|<>?]/g, '-')\n}\n\nfunction writeToReporters(reporters: LogReporter[], logEntry: LogEntry, filter: (reporterId: string) => boolean) {\n reporters.filter(r => filter(r.id)).forEach(r => r.write(logEntry!))\n}\n\n/**\n * Determines should you log.\n * @param loggerLevel Log level of the logger.\n * It can be undefined which the global log level will be used.\n */\nfunction shouldLog(store: LogStore, targetLevel: LogLevel, loggerLevel: LogLevel | undefined) {\n return targetLevel <= (loggerLevel !== undefined ? loggerLevel : store.logLevel)\n}\n","import { required, unpartial } from 'type-plus'\nimport { toInspectLogEntry } from './platform.js'\nimport { formatLogLevel } from './formatter.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\nimport { createConsoleLogReporter } from './console.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n logs: LogEntry[],\n /**\n * Gets a simple log message for testing.\n * The message only contains arguments for each log entry.\n */\n getLogMessage(): string,\n getLogMessages(): string[],\n getLogMessageWithLevel(): string,\n getLogMessagesWithIdAndLevel(): string[],\n emit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n return logs.map(toInspectLogEntry)\n .map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n .join('\\n')\n // if it has more than this log,\n // we assume it is running under tests,\n // and remove this log to simplify testing.\n .replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n return Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n const { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n const logs: LogEntry[] = []\n return {\n id,\n get formatter() { return formatter },\n get filter() { return filter },\n logs,\n write(entry: LogEntry) {\n if (filter && !filter(entry)) return\n logs.push(formatter(entry))\n },\n getLogMessage() {\n return this.getLogMessages().join('\\n')\n },\n getLogMessages() {\n return logs.map(toInspectLogEntry)\n .map(log => log.args.join(' '))\n },\n getLogMessagesWithIdAndLevel() {\n return logs.map(toInspectLogEntry)\n .map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n },\n getLogMessageWithLevel() { return toMessageWithLevel(logs) },\n /**\n * emit the saved log to console for easy debugging\n */\n emit() {\n const reporter = createConsoleLogReporter()\n logs.forEach(l => reporter.write(l))\n }\n }\n}\n\nexport function createMemoryWithConsoleLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n return Object.freeze(\n Object.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n isConsoleReporter: true\n }))\n}\n","import { record } from 'type-plus'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => e\n\nexport const polyfill: { console?: ConsoleLike } = record()\n","import { record } from 'type-plus'\nimport type { LogStore } from './logStore.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n configured?: boolean,\n gsl?: { store: LogStore, standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n","import { record, required } from 'type-plus'\nimport { createLogger } from './logger.js'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './logLevels.js'\nimport { createLogStore, LogStore } from './logStore.js'\nimport { createMemoryLogReporter, MemoryLogReporter } from './memory.js'\nimport { ctx } from './standardLog.ctx.js'\nimport type { Logger, LoggerOptions, LogLevel, LogMethodNames, StandardLogInstance, StandardLogOptions } from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {\n}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): StandardLog<N> {\n const closure = createStandardLogClosure(options)\n if (options?.reporters?.some(r => !r.id)) {\n const log = closure.standardLog.getLogger('standard-log')\n log.critical(`Detected reporter with empty id. This is not allowed as it will create problems with feature like 'getNonConsoleLogger()'. Please add an id to your reporter.`)\n }\n\n if (!ctx.gsl) ctx.gsl = closure as any\n return closure.standardLog\n}\n\nfunction noop() { }\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): { store: LogStore, standardLog: StandardLog<N> } {\n // TODO reporter.id must not be empty\n const store = createLogStore(required({ logLevel: logLevels.info }, options))\n const nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n const logMethods = DEFAULT_LOG_METHOD_NAMES\n .concat(Object.keys(options?.customLevels ?? {}))\n .concat(['on', 'count', 'write'])\n return {\n store,\n standardLog: {\n get logLevel() { return store.logLevel },\n\n toLogLevelName(level: number) {\n return store.logLevelStore.getName(level)\n },\n toLogLevel(name: string) {\n return store.logLevelStore.getLevel(name)\n },\n getLogger(id: string, options?: LoggerOptions) {\n if (store.loggers[id]) return store.loggers[id] as any\n return store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any\n },\n getNonConsoleLogger(id, options?) {\n if (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n if (store.loggers[id]) {\n const log = this.getLogger('standard-log')\n log.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n return store.nonConsoleLoggers[id] = createDummyLogger(logMethods)\n }\n\n return store.nonConsoleLoggers[id] = nonConsoleReporters.length === 0\n ? createDummyLogger(logMethods)\n : createLogger(store, id, {\n ssf: this.getNonConsoleLogger,\n ...options,\n writeTo(reporterId) {\n return nonConsoleReporters.indexOf(reporterId) >= 0\n }\n })\n },\n }\n }\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n return logMethods.reduce((p, m) => {\n p[m] = noop\n return p\n }, record()) as Logger\n}\n\nexport type StandardLogForTest<N extends string = LogMethodNames> = StandardLog<N> & { reporter: MemoryLogReporter }\n\nexport function createStandardLogForTest<N extends string = LogMethodNames>(\n logLevel: LogLevel = logLevels.debug\n): StandardLogForTest<N> {\n const reporter = createMemoryLogReporter()\n const closure = createStandardLogClosure<N>({ reporters: [reporter], logLevel })\n return { ...closure.standardLog, reporter }\n}\n\n/**\n * Suppress logging within the code block.\n */\nexport function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R\nexport function suppressLogs<R>(block: () => R, ...logs: Logger[]): R {\n const origLevels = logs.map(l => l.level)\n logs.forEach(l => l.level = logLevels.none)\n const result = block()\n logs.forEach((l, i) => l.level = origLevels[i])\n return result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n return getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n if (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n return ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n if (ctx.configured) {\n const log = ctx.gsl!.standardLog.getLogger('standard-log')\n log.warn('configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.')\n }\n\n if (ctx.gsl) {\n if (options.logLevel) {\n ctx.gsl.store.logLevel = options.logLevel\n }\n if (options.reporters) {\n const reporters = ctx.gsl.store.reporters\n reporters.length = 0\n reporters.push(...options.reporters)\n }\n }\n else {\n ctx.gsl = createStandardLogClosure(options)\n }\n ctx.configured = true\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.upperCase = exports.localeUpperCase = void 0;\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n az: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n lt: {\n regexp: /[\\u0069\\u006A\\u012F]\\u0307|\\u0069\\u0307[\\u0300\\u0301\\u0303]/g,\n map: {\n i̇: \"\\u0049\",\n j̇: \"\\u004A\",\n į̇: \"\\u012E\",\n i̇̀: \"\\u00CC\",\n i̇́: \"\\u00CD\",\n i̇̃: \"\\u0128\",\n },\n },\n};\n/**\n * Localized upper case.\n */\nfunction localeUpperCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return upperCase(str);\n}\nexports.localeUpperCase = localeUpperCase;\n/**\n * Upper case as a function.\n */\nfunction upperCase(str) {\n return str.toUpperCase();\n}\nexports.upperCase = upperCase;\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/unbound-method */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _SerializableConverter_instances, _SerializableConverter_plugins, _SerializableConverter_fromSerializable, _SerializableConverter_deserializeError, _SerializableConverter_toSerializable, _a, _IsoError_hasCause, _IsoError_toIsoError;\n//#region captureStackTrace polyfill\n// istanbul ignore next\nif (!Error.captureStackTrace) {\n Error.captureStackTrace = function (error) {\n const container = new Error();\n Object.defineProperty(error, 'stack', {\n configurable: true,\n get: function () {\n // Replace property with value for faster future accesses.\n defineStack(this, container.stack);\n return container.stack;\n },\n set: function (stack) { defineStack(error, stack); },\n });\n };\n}\n// istanbul ignore next\nfunction defineStack(target, value) {\n Object.defineProperty(target, 'stack', {\n configurable: true,\n value,\n writable: true,\n });\n}\nexport class SerializableConverter {\n constructor() {\n _SerializableConverter_instances.add(this);\n _SerializableConverter_plugins.set(this, []);\n }\n addPlugin(plugin) {\n __classPrivateFieldGet(this, _SerializableConverter_plugins, \"f\").unshift(plugin);\n }\n /**\n * Deserialize an `Error` from `Serializable`\n */\n fromSerializable(json, options) {\n const err = __classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_deserializeError).call(this, json);\n Error.captureStackTrace(err, options?.ssf);\n return err;\n }\n /**\n * Serialize `Error` to `Serializable`\n */\n toSerializable(err) {\n return __classPrivateFieldGet(this, _SerializableConverter_plugins, \"f\").reduce((p, s) => p || s.toSerializable(err), undefined) || __classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_toSerializable).call(this, err);\n }\n}\n_SerializableConverter_plugins = new WeakMap(), _SerializableConverter_instances = new WeakSet(), _SerializableConverter_fromSerializable = function _SerializableConverter_fromSerializable(json) {\n if (json.name === 'AggregateError') {\n const { message, errors, ...rest } = json;\n // @ts-ignore\n // istanbul ignore next\n if (global.AggregateError) {\n return Object.assign(new AggregateError(errors, message), rest);\n }\n else {\n return Object.assign(new Error(message), {\n ...rest,\n errors\n });\n }\n }\n const { message, cause, ...rest } = json;\n const causeError = cause ? __classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_deserializeError).call(this, cause) : undefined;\n if (json.name === 'Error') {\n return Object.assign(new Error(message), causeError ? { ...rest, cause: causeError } : rest);\n }\n // @ts-ignore\n return Object.assign(new IsoError(message, causeError ? { cause: causeError } : undefined), rest);\n}, _SerializableConverter_deserializeError = function _SerializableConverter_deserializeError(json) {\n let err = undefined;\n for (const { fromSerializable } of __classPrivateFieldGet(this, _SerializableConverter_plugins, \"f\")) {\n err = fromSerializable(json);\n if (err)\n break;\n }\n return err || __classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_fromSerializable).call(this, json);\n}, _SerializableConverter_toSerializable = function _SerializableConverter_toSerializable(err) {\n if (isAggregateError(err)) {\n return {\n ...err, name: err.constructor.name, message: err.message,\n errors: err.errors.map(__classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_toSerializable))\n };\n }\n if (err instanceof Error) {\n const { message, cause } = err;\n return cause\n ? { ...err, name: err.constructor.name, message, cause: __classPrivateFieldGet(this, _SerializableConverter_instances, \"m\", _SerializableConverter_toSerializable).call(this, cause) }\n : { ...err, name: err.constructor.name, message };\n }\n return err;\n};\n/**\n * Isomorphic Error that works across physical boundary.\n */\nexport class IsoError extends Error {\n /**\n * Create an IsoError with additional properties without the need to create a new class.\n * @param props properties of the IsoError\n */\n static create(props) {\n const { message, cause, ...rest } = props;\n const err = new IsoError(message, { cause, ssf: IsoError.create });\n return Object.assign(err, rest);\n }\n static stringify(err) {\n return this.serialize(err);\n }\n static serialize(err) {\n return JSON.stringify(this.toSerializable(err));\n }\n static toSerializable(err) {\n return this.converter.toSerializable(err);\n }\n /**\n * @type P Additional properties of the IsoError\n * @param text Json representation of a IsoError\n */\n static parse(text) {\n const json = JSON.parse(text);\n return this.converter.fromSerializable(json, { ssf: IsoError.parse });\n }\n /**\n * @type P Additional properties of the IsoError\n * @param text Json representation of a IsoError\n */\n static deserialize(text) {\n const json = JSON.parse(text);\n return this.converter.fromSerializable(json, { ssf: IsoError.deserialize });\n }\n static fromSerializable(json) {\n return this.converter.fromSerializable(json, { ssf: IsoError.fromSerializable });\n }\n /**\n * returns the error message including the error causes.\n */\n static trace(err) {\n const messages = [];\n if (err instanceof ModuleError) {\n messages.push(`${err.name}(${err.module}): ${err.message}`);\n }\n else if (err instanceof Error) {\n messages.push(`${err.name}: ${err.message}`);\n }\n if (isAggregateError(err)) {\n err.errors.forEach(e => messages.push(...this.trace(e).split('\\n').map(s => ' ' + s)));\n }\n if (err instanceof Error) {\n if (__classPrivateFieldGet(this, _a, \"m\", _IsoError_hasCause).call(this, err))\n messages.push(...this.trace(err.cause).split('\\n').map(s => ' ' + s));\n }\n else {\n messages.push(typeof err === 'string' ? err : JSON.stringify(err));\n }\n return messages.join('\\n');\n }\n static addPlugin(plugin) {\n this.converter.addPlugin(plugin);\n }\n constructor(message, options) {\n super(message);\n /**\n * Name of the error\n */\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Error cause\n */\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n // restore prototype chain\n const actualProto = new.target.prototype;\n this.name = actualProto.constructor.name;\n // istanbul ignore next\n if (Object.setPrototypeOf)\n Object.setPrototypeOf(this, actualProto);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n else\n this.__proto__ = actualProto;\n if (options?.cause)\n this.cause = __classPrivateFieldGet(IsoError, _a, \"m\", _IsoError_toIsoError).call(IsoError, options.cause);\n if (options?.ssf)\n Error.captureStackTrace(this, options.ssf);\n }\n toString() { return IsoError.serialize(this); }\n trace() { return IsoError.trace(this); }\n}\n_a = IsoError, _IsoError_hasCause = function _IsoError_hasCause(x) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return !!x.cause;\n}, _IsoError_toIsoError = function _IsoError_toIsoError(err) {\n if (err instanceof IsoError)\n return err;\n // When the error is an internal error from deserialization,\n // the err.constructor.name is object\n return Object.assign(err, { name: err.constructor.name !== 'Object' ? err.constructor.name : err.name });\n};\nObject.defineProperty(IsoError, \"converter\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new SerializableConverter()\n});\n/**\n * An IsoError with a module property.\n */\nexport class ModuleError extends IsoError {\n /**\n * @param module The module that defines this error.\n */\n constructor(module, message, options) {\n super(message, options);\n Object.defineProperty(this, \"module\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: module\n });\n }\n}\nexport function isAggregateError(error) {\n return error instanceof Error && Array.isArray(error.errors);\n}\n//# sourceMappingURL=index.js.map","export function mapKey(subject, predicate, thisArg) {\n return Object.keys(subject).map(predicate, thisArg);\n}\n//# sourceMappingURL=mapKey.js.map","export function record(value) {\n const r = Object.create(null);\n return (value ? Object.assign(r, value) : r);\n}\n//# sourceMappingURL=record.js.map","export function reduceByKey(subject, callbackfn, initialValue) {\n return Object.keys(subject).reduce(callbackfn, initialValue);\n}\n/**\n * @deprecated renamed to reduceByKey\n */\nexport const reduceKey = reduceByKey;\n//# sourceMappingURL=reduceKey.js.map","export function required(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => {\n return { ...p, ...e };\n });\n}\nexport function requiredDeep(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n if (entries[0] === undefined || entries[0] === null)\n return entries[0];\n return entries.filter(x => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n if (typeof source1 !== 'object' || source1 === null)\n return source2 !== undefined ? source2 : source1;\n if (Array.isArray(source1)) {\n if (Array.isArray(source2))\n return source2;\n if (source2 === undefined)\n return [...source1];\n return [...source1, source2];\n }\n return getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n // @ts-ignore\n p[k] = deepmerge(source1[k], source2 && source2[k]);\n return p;\n }, {});\n}\nfunction getAllKeys(subject, internal = false) {\n if (typeof subject !== 'object')\n return [];\n const propertyNames = Object.getOwnPropertyNames(subject);\n const keys = internal ? propertyNames.filter(n => n !== 'constructor') : propertyNames;\n const proto = Object.getPrototypeOf(subject);\n return proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nexport function unpartial(s1, s2, s3) {\n // defensive check for JS\n if (s1 === undefined || s1 === null)\n return s1;\n return [s1, s2, s3]\n .filter(notNil)\n .reduce((p, s) => ({ ...p, ...trimNilProps(s) }), {});\n}\nfunction trimNilProps(value) {\n return Object.keys(value).reduce((p, k) => {\n if (notNil(value[k]))\n p[k] = value[k];\n return p;\n }, {});\n}\nfunction notNil(value) {\n return value !== null && value !== undefined;\n}\nexport function unpartialRecursively(arg1, arg2, arg3) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return requiredDeep(arg1, arg2, arg3);\n}\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './console.js'\nexport * from './errors.js'\nexport * from './formatter.js'\nexport * from './logLevels.js'\nexport * from './memory.js'\nexport {\n configGlobal, createStandardLog, createStandardLogForTest,\n getLogger, suppressLogs\n} from './standardLog.js'\nexport type { GetLogger, StandardLog, StandardLogForTest } from './standardLog.js'\nexport type {\n ConsoleLike, LogEntry, LogFilter, LogFormatter, LogFunction, Logger, LoggerOptions, LogLevel,\n LogLevelEntry, LogMethod, LogMethodNames, LogReporter, LogReporterOptions, ReporterFilter,\n StandardLogInstance, StandardLogOptions\n} from './types.js'\n\n"],"names":[],"sourceRoot":""}
|
|
Binary file
|
package/esm/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export * from './formatter.js';
|
|
|
4
4
|
export * from './logLevels.js';
|
|
5
5
|
export * from './memory.js';
|
|
6
6
|
export { configGlobal, createStandardLog, createStandardLogForTest, getLogger, suppressLogs } from './standardLog.js';
|
|
7
|
-
export type { StandardLog, StandardLogForTest
|
|
8
|
-
export
|
|
7
|
+
export type { GetLogger, StandardLog, StandardLogForTest } from './standardLog.js';
|
|
8
|
+
export type { ConsoleLike, LogEntry, LogFilter, LogFormatter, LogFunction, Logger, LoggerOptions, LogLevel, LogLevelEntry, LogMethod, LogMethodNames, LogReporter, LogReporterOptions, ReporterFilter, StandardLogInstance, StandardLogOptions } from './types.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EACzD,SAAS,EAAE,YAAY,EACxB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EACzD,SAAS,EAAE,YAAY,EACxB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAClF,YAAY,EACV,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAC5F,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EACzF,mBAAmB,EAAE,kBAAkB,EACxC,MAAM,YAAY,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -4,5 +4,4 @@ export * from './formatter.js';
|
|
|
4
4
|
export * from './logLevels.js';
|
|
5
5
|
export * from './memory.js';
|
|
6
6
|
export { configGlobal, createStandardLog, createStandardLogForTest, getLogger, suppressLogs } from './standardLog.js';
|
|
7
|
-
export * from './types.js';
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EACzD,SAAS,EAAE,YAAY,EACxB,MAAM,kBAAkB,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EACzD,SAAS,EAAE,YAAY,EACxB,MAAM,kBAAkB,CAAA","sourcesContent":["export * from './console.js'\nexport * from './errors.js'\nexport * from './formatter.js'\nexport * from './logLevels.js'\nexport * from './memory.js'\nexport {\n configGlobal, createStandardLog, createStandardLogForTest,\n getLogger, suppressLogs\n} from './standardLog.js'\nexport type { GetLogger, StandardLog, StandardLogForTest } from './standardLog.js'\nexport type {\n ConsoleLike, LogEntry, LogFilter, LogFormatter, LogFunction, Logger, LoggerOptions, LogLevel,\n LogLevelEntry, LogMethod, LogMethodNames, LogReporter, LogReporterOptions, ReporterFilter,\n StandardLogInstance, StandardLogOptions\n} from './types.js'\n\n"]}
|
package/esm/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../ts/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAyB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAe,MAAM,YAAY,CAAA;AAG3G,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,EAC5D,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GACnD,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../ts/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAyB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAe,MAAM,YAAY,CAAA;AAG3G,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,cAAc,EAC5D,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GACnD,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,CAwD5B"}
|
package/esm/logger.js
CHANGED
|
@@ -22,11 +22,10 @@ export function createLogger(store, id, options) {
|
|
|
22
22
|
count: {
|
|
23
23
|
writable: false,
|
|
24
24
|
value: ((counter) => (...args) => {
|
|
25
|
-
|
|
26
|
-
if (shouldLog(store, level, logger.level))
|
|
25
|
+
if (shouldLog(store, logLevels.debug, logger.level))
|
|
27
26
|
write({
|
|
28
27
|
id,
|
|
29
|
-
level,
|
|
28
|
+
level: logLevels.debug,
|
|
30
29
|
args: [++counter, ...args],
|
|
31
30
|
timestamp: new Date()
|
|
32
31
|
});
|
|
@@ -35,11 +34,12 @@ export function createLogger(store, id, options) {
|
|
|
35
34
|
on: {
|
|
36
35
|
writable: false,
|
|
37
36
|
value: (level, logFn) => {
|
|
37
|
+
var _a;
|
|
38
38
|
const logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level) : level;
|
|
39
39
|
if (shouldLog(store, logLevel, logger.level)) {
|
|
40
40
|
const methodName = store.logLevelStore.getName(logLevel);
|
|
41
41
|
const bindedMethod = logger[methodName].bind(logger);
|
|
42
|
-
const result = logFn(bindedMethod);
|
|
42
|
+
const result = logFn(bindedMethod, (_a = logger.level) !== null && _a !== void 0 ? _a : store.logLevel);
|
|
43
43
|
if (result)
|
|
44
44
|
bindedMethod(result);
|
|
45
45
|
}
|
package/esm/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../ts/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAK1C,MAAM,UAAU,YAAY,CAC1B,KAAe,EAAE,EAAU,EAAE,OAAuB;;IAEpD,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;IACnB,MAAM,OAAO,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IAChD,M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AE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAA;YAC9F,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,UAAU,CAAC,EAAU;IAC5B,OAAO,EAAE,CAAC,OAAO,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAwB,EAAE,QAAkB,EAAE,MAAuC;IAC7G,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC,CAAA;AACtE,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAe,EAAE,WAAqB,EAAE,WAAiC;IAC1F,OAAO,WAAW,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;AAClF,CAAC","sourcesContent":["import { logLevels } from './logLevels.js'\nimport { LogStore } from './logStore.js'\nimport type { LogEntry, LogFunction, Logger, LoggerOptions, LogMethodNames, LogReporter } from './types.js'\nimport { LogLevel } from './types.js'\n\nexport function createLogger<N extends string = LogMethodNames>(\n store: LogStore, id: string, options?: LoggerOptions\n): Logger<N | LogMethodNames> {\n id = sanitizeId(id)\n const writeTo = options?.writeTo ?? (() => true)\n const [filter, reporters]: [(reporterId: string) => boolean, LogReporter[]] = typeof writeTo === 'string'\n ? [id => id === writeTo, store.reporters]\n : writeTo instanceof RegExp\n ? [id => writeTo.test(id), store.reporters]\n : typeof writeTo === 'function'\n ? [writeTo, store.reporters]\n : [() => true, [writeTo]]\n\n function write(entry: LogEntry) {\n writeToReporters(reporters, entry, filter)\n }\n\n const logger = {\n level: options?.level,\n write\n } as any\n\n Object.defineProperties(logger, {\n id: { value: id, writable: false },\n count: {\n writable: false,\n value: ((counter) => (...args: any[]) => {\n if (shouldLog(store, logLevels.debug, logger.level))\n write({\n id,\n level: logLevels.debug,\n args: [++counter, ...args],\n timestamp: new Date()\n })\n })(0)\n },\n on: {\n writable: false,\n value: (level: number | N | LogMethodNames, logFn: LogFunction) => {\n const logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level)! : level\n if (shouldLog(store, logLevel, logger.level)) {\n const methodName = store.logLevelStore.getName(logLevel)\n const bindedMethod = logger[methodName].bind(logger)\n const result = logFn(bindedMethod, logger.level ?? store.logLevel)\n if (result) bindedMethod(result)\n }\n }\n }\n })\n store.logLevelStore.getAllLevels().forEach(function addMethod({ name, level }) {\n Object.defineProperty(logger, name, {\n writable: false,\n value: (...args: any[]) => {\n if (shouldLog(store, level, logger.level)) write({ id, level, args, timestamp: new Date() })\n }\n })\n })\n return logger\n}\n\nfunction sanitizeId(id: string) {\n return id.replace(/[`~!#$%^&*()=+[\\]{},|<>?]/g, '-')\n}\n\nfunction writeToReporters(reporters: LogReporter[], logEntry: LogEntry, filter: (reporterId: string) => boolean) {\n reporters.filter(r => filter(r.id)).forEach(r => r.write(logEntry!))\n}\n\n/**\n * Determines should you log.\n * @param loggerLevel Log level of the logger.\n * It can be undefined which the global log level will be used.\n */\nfunction shouldLog(store: LogStore, targetLevel: LogLevel, loggerLevel: LogLevel | undefined) {\n return targetLevel <= (loggerLevel !== undefined ? loggerLevel : store.logLevel)\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogStore } from './logStore.js';
|
|
2
|
+
import type { LogMethodNames, StandardLogInstance } from './types.js';
|
|
3
|
+
export declare const ctx: {
|
|
4
|
+
configured?: boolean;
|
|
5
|
+
gsl?: {
|
|
6
|
+
store: LogStore;
|
|
7
|
+
standardLog: StandardLogInstance<LogMethodNames>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=standardLog.ctx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardLog.ctx.d.ts","sourceRoot":"","sources":["../ts/standardLog.ctx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErE,eAAO,MAAM,GAAG,EAAE;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,WAAW,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAA;KAAE,CAAA;CACjE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardLog.ctx.js","sourceRoot":"","sources":["../ts/standardLog.ctx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAIlC,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAM,EAAE,CAAA","sourcesContent":["import { record } from 'type-plus'\nimport type { LogStore } from './logStore.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n configured?: boolean,\n gsl?: { store: LogStore, standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n"]}
|
package/esm/standardLog.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { LogStore } from './logStore.js';
|
|
2
2
|
import { MemoryLogReporter } from './memory.js';
|
|
3
|
-
import type { Logger, LoggerOptions, LogLevel, LogMethodNames, StandardLogOptions } from './types.js';
|
|
4
|
-
export interface StandardLogInstance<N extends string = LogMethodNames> {
|
|
5
|
-
logLevel: number;
|
|
6
|
-
toLogLevelName(level: number): string;
|
|
7
|
-
toLogLevel(name: N): number;
|
|
8
|
-
getLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
|
|
9
|
-
getNonConsoleLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
|
|
10
|
-
}
|
|
3
|
+
import type { Logger, LoggerOptions, LogLevel, LogMethodNames, StandardLogInstance, StandardLogOptions } from './types.js';
|
|
11
4
|
export interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {
|
|
12
5
|
}
|
|
13
6
|
export declare function createStandardLog<N extends string = LogMethodNames>(options?: StandardLogOptions<N>): StandardLog<N>;
|
|
@@ -25,12 +18,5 @@ export declare function createStandardLogForTest<N extends string = LogMethodNam
|
|
|
25
18
|
export declare function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R;
|
|
26
19
|
export declare type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>;
|
|
27
20
|
export declare function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions): Logger<LogMethodNames | N>;
|
|
28
|
-
export declare const ctx: {
|
|
29
|
-
configured?: boolean;
|
|
30
|
-
gsl?: {
|
|
31
|
-
store: LogStore;
|
|
32
|
-
standardLog: StandardLogInstance<LogMethodNames>;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
21
|
export declare function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>): void;
|
|
36
22
|
//# sourceMappingURL=standardLog.d.ts.map
|
package/esm/standardLog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardLog.d.ts","sourceRoot":"","sources":["../ts/standardLog.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAA2B,iBAAiB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"standardLog.d.ts","sourceRoot":"","sources":["../ts/standardLog.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAA2B,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAExE,OAAO,KAAK,EAAE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E,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,8BAE/F;AAQD,wBAAgB,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC,QAoB7E"}
|
package/esm/standardLog.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createLogger } from './logger.js';
|
|
|
3
3
|
import { DEFAULT_LOG_METHOD_NAMES, logLevels } from './logLevels.js';
|
|
4
4
|
import { createLogStore } from './logStore.js';
|
|
5
5
|
import { createMemoryLogReporter } from './memory.js';
|
|
6
|
+
import { ctx } from './standardLog.ctx.js';
|
|
6
7
|
export function createStandardLog(options) {
|
|
7
8
|
var _a;
|
|
8
9
|
const closure = createStandardLogClosure(options);
|
|
@@ -80,7 +81,6 @@ export function suppressLogs(block, ...logs) {
|
|
|
80
81
|
export function getLogger(id, options) {
|
|
81
82
|
return getGlobalSL().getLogger(id, options);
|
|
82
83
|
}
|
|
83
|
-
export const ctx = record();
|
|
84
84
|
function getGlobalSL() {
|
|
85
85
|
if (!ctx.gsl)
|
|
86
86
|
ctx.gsl = createStandardLogClosure();
|
package/esm/standardLog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardLog.js","sourceRoot":"","sources":["../ts/standardLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EAAE,cAAc,EAAY,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAqB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"standardLog.js","sourceRoot":"","sources":["../ts/standardLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EA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,CAAA;AACvB,CAAC","sourcesContent":["import { record, required } from 'type-plus'\nimport { createLogger } from './logger.js'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './logLevels.js'\nimport { createLogStore, LogStore } from './logStore.js'\nimport { createMemoryLogReporter, MemoryLogReporter } from './memory.js'\nimport { ctx } from './standardLog.ctx.js'\nimport type { Logger, LoggerOptions, LogLevel, LogMethodNames, StandardLogInstance, StandardLogOptions } from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {\n}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): StandardLog<N> {\n const closure = createStandardLogClosure(options)\n if (options?.reporters?.some(r => !r.id)) {\n const log = closure.standardLog.getLogger('standard-log')\n log.critical(`Detected reporter with empty id. This is not allowed as it will create problems with feature like 'getNonConsoleLogger()'. Please add an id to your reporter.`)\n }\n\n if (!ctx.gsl) ctx.gsl = closure as any\n return closure.standardLog\n}\n\nfunction noop() { }\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n options?: StandardLogOptions<N>\n): { store: LogStore, standardLog: StandardLog<N> } {\n // TODO reporter.id must not be empty\n const store = createLogStore(required({ logLevel: logLevels.info }, options))\n const nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n const logMethods = DEFAULT_LOG_METHOD_NAMES\n .concat(Object.keys(options?.customLevels ?? {}))\n .concat(['on', 'count', 'write'])\n return {\n store,\n standardLog: {\n get logLevel() { return store.logLevel },\n\n toLogLevelName(level: number) {\n return store.logLevelStore.getName(level)\n },\n toLogLevel(name: string) {\n return store.logLevelStore.getLevel(name)\n },\n getLogger(id: string, options?: LoggerOptions) {\n if (store.loggers[id]) return store.loggers[id] as any\n return store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any\n },\n getNonConsoleLogger(id, options?) {\n if (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n if (store.loggers[id]) {\n const log = this.getLogger('standard-log')\n log.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n return store.nonConsoleLoggers[id] = createDummyLogger(logMethods)\n }\n\n return store.nonConsoleLoggers[id] = nonConsoleReporters.length === 0\n ? createDummyLogger(logMethods)\n : createLogger(store, id, {\n ssf: this.getNonConsoleLogger,\n ...options,\n writeTo(reporterId) {\n return nonConsoleReporters.indexOf(reporterId) >= 0\n }\n })\n },\n }\n }\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n return logMethods.reduce((p, m) => {\n p[m] = noop\n return p\n }, record()) as Logger\n}\n\nexport type StandardLogForTest<N extends string = LogMethodNames> = StandardLog<N> & { reporter: MemoryLogReporter }\n\nexport function createStandardLogForTest<N extends string = LogMethodNames>(\n logLevel: LogLevel = logLevels.debug\n): StandardLogForTest<N> {\n const reporter = createMemoryLogReporter()\n const closure = createStandardLogClosure<N>({ reporters: [reporter], logLevel })\n return { ...closure.standardLog, reporter }\n}\n\n/**\n * Suppress logging within the code block.\n */\nexport function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R\nexport function suppressLogs<R>(block: () => R, ...logs: Logger[]): R {\n const origLevels = logs.map(l => l.level)\n logs.forEach(l => l.level = logLevels.none)\n const result = block()\n logs.forEach((l, i) => l.level = origLevels[i])\n return result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n return getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n if (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n return ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n if (ctx.configured) {\n const log = ctx.gsl!.standardLog.getLogger('standard-log')\n log.warn('configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.')\n }\n\n if (ctx.gsl) {\n if (options.logLevel) {\n ctx.gsl.store.logLevel = options.logLevel\n }\n if (options.reporters) {\n const reporters = ctx.gsl.store.reporters\n reporters.length = 0\n reporters.push(...options.reporters)\n }\n }\n else {\n ctx.gsl = createStandardLogClosure(options)\n }\n ctx.configured = true\n}\n"]}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StackTraceMeta } from '@just-func/types';
|
|
1
|
+
import type { StackTraceMeta } from '@just-func/types';
|
|
2
2
|
export declare type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {
|
|
3
3
|
customLevels?: Record<CustomLevelNames, number>;
|
|
4
4
|
logLevel?: number;
|
|
@@ -38,8 +38,15 @@ export declare type LogEntry = {
|
|
|
38
38
|
timestamp: Date;
|
|
39
39
|
};
|
|
40
40
|
export declare type LogMethod = (...args: any[]) => void;
|
|
41
|
-
export declare type LogFunction = (
|
|
41
|
+
export declare type LogFunction = (log: LogMethod, logLevel: number) => string | void;
|
|
42
42
|
export declare type ReporterFilter = string | RegExp | ((reporterId: string) => boolean);
|
|
43
|
+
export interface StandardLogInstance<N extends string = LogMethodNames> {
|
|
44
|
+
logLevel: number;
|
|
45
|
+
toLogLevelName(level: number): string;
|
|
46
|
+
toLogLevel(name: N): number;
|
|
47
|
+
getLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
|
|
48
|
+
getNonConsoleLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
|
|
49
|
+
}
|
|
43
50
|
/**
|
|
44
51
|
* Formats a log entry.
|
|
45
52
|
* Depends on the reporter, it can expect a different return type.
|
package/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types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AC,EAAE,SAAS,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;CAC7B;AAED,oBAAY,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI;IACxC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAED,oBAAY,QAAQ,GAAG,MAAM,CAAA;AAE7B,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CAC7B"}
|
package/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StackTraceMeta } from '@just-func/types'\n\nexport type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {\n customLevels?: Record<CustomLevelNames, number>,\n logLevel?: number,\n reporters?: LogReporter[]\n}\n\nexport interface LoggerOptions extends StackTraceMeta {\n level?: number,\n writeTo?: LogReporter | ReporterFilter\n}\n\nexport type Logger<N extends string = LogMethodNames> = {\n readonly id: string,\n /**\n * Logger local log level.\n */\n level?: number,\n /**\n * Logs with an increment counter.\n * This is useful during debugging to check for steps executed.\n */\n count(...args: any[]): void,\n on(level: number | N, logFunction: LogFunction): void,\n /**\n * Write custom log entries.\n */\n write(entry: LogEntry): void\n} & { [k in N]: LogMethod }\n\n/**\n * Names of the standard log methods.\n */\nexport type LogMethodNames = 'emergency' | 'alert' | 'critical' | 'error' | 'warn' | 'notice' | 'info' | 'debug' | 'trace' | 'planck'\n\nexport type LogEntry = {\n id: string,\n level: number,\n // args instead of messages because it is `any[]` instead of `string[]`\n args: any[],\n timestamp: Date\n}\n\nexport type LogMethod = (...args: any[]) => void\n\nexport type LogFunction = (
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StackTraceMeta } from '@just-func/types'\n\nexport type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {\n customLevels?: Record<CustomLevelNames, number>,\n logLevel?: number,\n reporters?: LogReporter[]\n}\n\nexport interface LoggerOptions extends StackTraceMeta {\n level?: number,\n writeTo?: LogReporter | ReporterFilter\n}\n\nexport type Logger<N extends string = LogMethodNames> = {\n readonly id: string,\n /**\n * Logger local log level.\n */\n level?: number,\n /**\n * Logs with an increment counter.\n * This is useful during debugging to check for steps executed.\n */\n count(...args: any[]): void,\n on(level: number | N, logFunction: LogFunction): void,\n /**\n * Write custom log entries.\n */\n write(entry: LogEntry): void\n} & { [k in N]: LogMethod }\n\n/**\n * Names of the standard log methods.\n */\nexport type LogMethodNames = 'emergency' | 'alert' | 'critical' | 'error' | 'warn' | 'notice' | 'info' | 'debug' | 'trace' | 'planck'\n\nexport type LogEntry = {\n id: string,\n level: number,\n // args instead of messages because it is `any[]` instead of `string[]`\n args: any[],\n timestamp: Date\n}\n\nexport type LogMethod = (...args: any[]) => void\n\nexport type LogFunction = (log: LogMethod, logLevel: number) => string | void\n\nexport type ReporterFilter = string | RegExp | ((reporterId: string) => boolean)\n\nexport interface StandardLogInstance<N extends string = LogMethodNames> {\n logLevel: number,\n toLogLevelName(level: number): string,\n toLogLevel(name: N): number,\n getLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>,\n getNonConsoleLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>\n}\n\n/**\n * Formats a log entry.\n * Depends on the reporter, it can expect a different return type.\n * By default the return type is `any[]` which the `console` accepts.\n */\nexport type LogFormatter<T = any[]> = (entry: LogEntry) => T\n\n/**\n * Determines whether the entry should be written.\n */\nexport type LogFilter = (entry: LogEntry) => boolean\n\nexport type LogLevelEntry = { name: string, level: number }\n\nexport interface LogReporter<T = any> {\n readonly id: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n readonly formatter: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n readonly filter?: LogFilter,\n /**\n * Indicate if this is a console reporter.\n * There is only one console reporter can be present in the system.\n */\n readonly isConsoleReporter?: boolean,\n write(entry: LogEntry): void\n}\n\nexport type LogReporterOptions<T = any> = {\n id?: string,\n /**\n * Specifies the formatter to be used by the reporter.\n * Using this you can customize how the reporter writes the log entry.\n */\n formatter?: LogFormatter<T>,\n /**\n * Specifies a filter to determine should the log be written.\n */\n filter?: LogFilter\n}\n\nexport type LogLevel = number\n\nexport interface ConsoleLike {\n debug(...args: any[]): void,\n info(...args: any[]): void,\n warn(...args: any[]): void,\n error(...args: any[]): void,\n}\n"]}
|