standard-log 13.3.1 → 13.3.2

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.
Files changed (55) hide show
  1. package/cjs/log_store.d.ts.map +1 -1
  2. package/cjs/log_store.js +7 -7
  3. package/cjs/log_store.js.map +1 -1
  4. package/cjs/memory.d.ts.map +1 -1
  5. package/cjs/memory.js +1 -2
  6. package/cjs/memory.js.map +1 -1
  7. package/cjs/platform.browser.js +2 -2
  8. package/cjs/platform.browser.js.map +1 -1
  9. package/cjs/platform.js +2 -2
  10. package/cjs/platform.js.map +1 -1
  11. package/cjs/record.d.ts +9 -0
  12. package/cjs/record.d.ts.map +1 -0
  13. package/cjs/record.js +15 -0
  14. package/cjs/record.js.map +1 -0
  15. package/cjs/standard_log.ctx.js +1 -1
  16. package/cjs/standard_log.ctx.js.map +1 -1
  17. package/cjs/standard_log.d.ts.map +1 -1
  18. package/cjs/standard_log.js +4 -3
  19. package/cjs/standard_log.js.map +1 -1
  20. package/cjs/types.d.ts +5 -2
  21. package/cjs/types.d.ts.map +1 -1
  22. package/dist/standard-log.esm.js +22 -97
  23. package/dist/standard-log.esm.js.map +1 -1
  24. package/dist/standard-log.iife.js +22 -97
  25. package/dist/standard-log.iife.js.map +1 -1
  26. package/esm/log_store.d.ts.map +1 -1
  27. package/esm/log_store.js +4 -4
  28. package/esm/log_store.js.map +1 -1
  29. package/esm/memory.d.ts.map +1 -1
  30. package/esm/memory.js +1 -2
  31. package/esm/memory.js.map +1 -1
  32. package/esm/platform.browser.js +1 -1
  33. package/esm/platform.browser.js.map +1 -1
  34. package/esm/platform.js +1 -1
  35. package/esm/platform.js.map +1 -1
  36. package/esm/record.d.ts +9 -0
  37. package/esm/record.d.ts.map +1 -0
  38. package/esm/record.js +14 -0
  39. package/esm/record.js.map +1 -0
  40. package/esm/standard_log.ctx.js +1 -1
  41. package/esm/standard_log.ctx.js.map +1 -1
  42. package/esm/standard_log.d.ts.map +1 -1
  43. package/esm/standard_log.js +2 -1
  44. package/esm/standard_log.js.map +1 -1
  45. package/esm/types.d.ts +5 -2
  46. package/esm/types.d.ts.map +1 -1
  47. package/package.json +5 -6
  48. package/ts/log_store.ts +4 -6
  49. package/ts/memory.ts +1 -2
  50. package/ts/platform.browser.ts +1 -1
  51. package/ts/platform.ts +1 -1
  52. package/ts/record.ts +9 -0
  53. package/ts/standard_log.ctx.ts +1 -1
  54. package/ts/standard_log.ts +2 -1
  55. package/ts/types.ts +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"standard-log.iife.js","names":["ms","required","_required"],"sources":["../../../node_modules/.pnpm/unpartial@1.0.8/node_modules/unpartial/esm/index.js","../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","../ts/log_levels.ts","../ts/formatter.ts","../../../node_modules/.pnpm/type-plus@8.0.0-beta.12_typescript@7.0.2/node_modules/type-plus/esm/object/map-key.js","../../../node_modules/.pnpm/type-plus@8.0.0-beta.12_typescript@7.0.2/node_modules/type-plus/esm/object/reduce-key.js","../../../node_modules/.pnpm/type-plus@8.0.0-beta.12_typescript@7.0.2/node_modules/type-plus/esm/object/record.js","../../../node_modules/.pnpm/unpartial@1.0.7/node_modules/unpartial/esm/index.js","../../../node_modules/.pnpm/type-plus@8.0.0-beta.12_typescript@7.0.2/node_modules/type-plus/esm/unpartial.js","../ts/platform.browser.ts","../ts/console.ts","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/typeof.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPrimitive.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPropertyKey.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/assertClassBrand.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/index.js","../ts/errors.ts","../ts/memory.ts","../ts/log_store.ts","../ts/logger.ts","../ts/standard_log.ctx.ts","../ts/standard_log.ts"],"sourcesContent":["//#region ts/index.ts\nfunction required(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => {\n\t\treturn {\n\t\t\t...p,\n\t\t\t...e\n\t\t};\n\t});\n}\nfunction requiredDeep(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n\tif (entries[0] === void 0 || entries[0] === null) return entries[0];\n\treturn entries.filter((x) => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n\tif (typeof source1 !== \"object\" || source1 === null) return source2 !== void 0 ? source2 : source1;\n\tif (Array.isArray(source1)) {\n\t\tif (Array.isArray(source2)) return source2;\n\t\tif (source2 === void 0) return [...source1];\n\t\treturn [...source1, source2];\n\t}\n\treturn getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n\t\tp[k] = deepmerge(source1[k], source2 && source2[k]);\n\t\treturn p;\n\t}, {});\n}\nfunction getAllKeys(subject, internal = false) {\n\tif (typeof subject !== \"object\") return [];\n\tconst propertyNames = Object.getOwnPropertyNames(subject);\n\tconst keys = internal ? propertyNames.filter((n) => n !== \"constructor\") : propertyNames;\n\tconst proto = Object.getPrototypeOf(subject);\n\treturn proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nfunction unpartial(s1, s2, s3) {\n\tif (s1 === void 0 || s1 === null) return s1;\n\treturn [\n\t\ts1,\n\t\ts2,\n\t\ts3\n\t].filter(notNil).reduce((p, s) => ({\n\t\t...p,\n\t\t...trimNilProps(s)\n\t}), {});\n}\nfunction trimNilProps(value) {\n\treturn Object.keys(value).reduce((p, k) => {\n\t\tif (notNil(value[k])) p[k] = value[k];\n\t\treturn p;\n\t}, {});\n}\nfunction notNil(value) {\n\treturn value !== null && value !== void 0;\n}\nfunction unpartialRecursively(arg1, arg2, arg3) {\n\treturn requiredDeep(arg1, arg2, arg3);\n}\n//#endregion\nexport { required, requiredDeep, unpartial, unpartialRecursively };\n\n//# sourceMappingURL=index.js.map","/**\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","export const logLevels = {\n\t/**\n\t * none: 0\n\t */\n\tnone: 0 as const,\n\t/**\n\t * emergency: 100\n\t *\n\t * emergency -> alert\n\t */\n\temergency: 100 as const,\n\t/**\n\t * alert: 200\n\t *\n\t * emergency -> alert -> critical\n\t */\n\talert: 200 as const,\n\t/**\n\t * critical: 300\n\t *\n\t * alert -> critical -> error\n\t */\n\tcritical: 300 as const,\n\t/**\n\t * error: 400\n\t *\n\t * critical -> error -> warn\n\t */\n\terror: 400 as const,\n\t/**\n\t * warn: 500\n\t *\n\t * error -> warn -> notice\n\t */\n\twarn: 500 as const,\n\t/**\n\t * notice: 600\n\t *\n\t * warn -> notice -> info\n\t */\n\tnotice: 600 as const,\n\t/**\n\t * info: 700\n\t *\n\t * notice -> info -> debug\n\t */\n\tinfo: 700 as const,\n\t/**\n\t * debug: 800\n\t *\n\t * info -> debug -> trace\n\t */\n\tdebug: 800 as const,\n\t/**\n\t * trace: 900\n\t *\n\t * debug -> trace -> planck\n\t */\n\ttrace: 900 as const,\n\t/**\n\t * planck: Infinity\n\t * `planck unit` is a very small unit <https://en.wikipedia.org/wiki/Planck_units>.\n\t *\n\t * trace -> planck\n\t */\n\tplanck: Number.POSITIVE_INFINITY,\n\t/**\n\t * all: Infinity\n\t */\n\tall: Number.POSITIVE_INFINITY\n}\n\n/**\n * Convert default log level value to log level name.\n */\nexport function toLogLevelName(level: number) {\n\tif (level <= 100) return 'emergency'\n\tif (level <= 200) return 'alert'\n\tif (level <= 300) return 'critical'\n\tif (level <= 400) return 'error'\n\tif (level <= 500) return 'warn'\n\tif (level <= 600) return 'notice'\n\tif (level <= 700) return 'info'\n\tif (level <= 800) return 'debug'\n\tif (level <= 900) return 'trace'\n\treturn 'planck'\n}\n\n/**\n * Convert default log level name to log level value.\n */\nexport function toLogLevel(name: string): number | undefined {\n\treturn (logLevels as any)[name.toLocaleLowerCase()]\n}\n\nexport const DEFAULT_LOG_METHOD_NAMES: string[] = [\n\t'emergency',\n\t'alert',\n\t'critical',\n\t'error',\n\t'warn',\n\t'notice',\n\t'info',\n\t'debug',\n\t'trace',\n\t'planck'\n]\n","import ms from 'ms'\nimport { toLogLevelName } from './log_levels.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\tswitch (format) {\n\t\tcase 'none':\n\t\t\treturn (_timestamp: Date) => undefined\n\t\tcase 'iso':\n\t\t\treturn (timestamp: Date) => timestamp.toISOString()\n\t\tcase 'elapsed': {\n\t\t\tlet lastTick: number\n\t\t\treturn (timestamp: Date) => {\n\t\t\t\tconst newTick = timestamp.getTime()\n\t\t\t\tconst result = ms(lastTick === undefined ? 0 : newTick - lastTick)\n\t\t\t\tlastTick = newTick\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function formatLogLevel(level: number) {\n\treturn `(${toLogLevelName(level).toUpperCase()})`\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\treturn [timestamp.toISOString(), id, formatLogLevel(level), ...args]\n}\n\n/**\n * Formats log entry like default console log.\n */\nexport function consoleFormatter({ args }: LogEntry) {\n\treturn args\n}\n","/**\n * `Array.prototype.map` over the *keys* of `subject`. Returns an array of the\n * callback results in `Object.keys()` order -- an array, not a record.\n *\n * @example\n * ```ts\n * const r = mapKey({ a: 1, b: 2 }, (k, i) => `${String(k)}${i}`)\n * // r === ['a0', 'b1']\n *\n * const r = mapKey({ a: 1, b: 2 }, (k, _i, _a, s) => s[k])\n * // r === [1, 2]\n * ```\n */\nexport function mapKey(subject, predicate, thisArg) {\n return Object.keys(subject).map(function (k, i, a) {\n return predicate.apply(this, [k, i, a, subject]);\n }, thisArg);\n}\n//# sourceMappingURL=map-key.js.map","/**\n * `Array.prototype.reduce` over the *keys* of `subject`, in\n * `Object.keys()` order.\n *\n * The callback receives the accumulator, the key, the index, the whole key\n * array and `subject` itself, so the value is reachable as `subject[key]`\n * without closing over it.\n *\n * Only own enumerable string keys are visited; symbol keys and inherited\n * properties are skipped.\n *\n * @example\n * ```ts\n * const r = reduceByKey({ a: 1, b: 2 }, (acc, k) => acc + String(k), '')\n * // r === 'ab'\n *\n * const sum = reduceByKey({ a: 1, b: 2 }, (acc, k, _i, _a, s) => acc + s[k], 0)\n * // sum === 3\n * ```\n */\nexport function reduceByKey(subject, callbackfn, initialValue) {\n return Object.keys(subject).reduce((p, k, i, a) => callbackfn(p, k, i, a, subject), initialValue);\n}\n//# sourceMappingURL=reduce-key.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","//#region ts/index.ts\nfunction required(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => {\n\t\treturn {\n\t\t\t...p,\n\t\t\t...e\n\t\t};\n\t});\n}\nfunction requiredDeep(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n\tif (entries[0] === void 0 || entries[0] === null) return entries[0];\n\treturn entries.filter((x) => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n\tif (typeof source1 !== \"object\" || source1 === null) return source2 !== void 0 ? source2 : source1;\n\tif (Array.isArray(source1)) {\n\t\tif (Array.isArray(source2)) return source2;\n\t\tif (source2 === void 0) return [...source1];\n\t\treturn [...source1, source2];\n\t}\n\treturn getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n\t\tp[k] = deepmerge(source1[k], source2 && source2[k]);\n\t\treturn p;\n\t}, {});\n}\nfunction getAllKeys(subject, internal = false) {\n\tif (typeof subject !== \"object\") return [];\n\tconst propertyNames = Object.getOwnPropertyNames(subject);\n\tconst keys = internal ? propertyNames.filter((n) => n !== \"constructor\") : propertyNames;\n\tconst proto = Object.getPrototypeOf(subject);\n\treturn proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nfunction unpartial(s1, s2, s3) {\n\tif (s1 === void 0 || s1 === null) return s1;\n\treturn [\n\t\ts1,\n\t\ts2,\n\t\ts3\n\t].filter(notNil).reduce((p, s) => ({\n\t\t...p,\n\t\t...trimNilProps(s)\n\t}), {});\n}\nfunction trimNilProps(value) {\n\treturn Object.keys(value).reduce((p, k) => {\n\t\tif (notNil(value[k])) p[k] = value[k];\n\t\treturn p;\n\t}, {});\n}\nfunction notNil(value) {\n\treturn value !== null && value !== void 0;\n}\nfunction unpartialRecursively(arg1, arg2, arg3) {\n\treturn requiredDeep(arg1, arg2, arg3);\n}\n//#endregion\nexport { required, requiredDeep, unpartial, unpartialRecursively };\n\n//# sourceMappingURL=index.js.map","import { required as _required, requiredDeep as _requiredDeep } from 'unpartial';\n/**\n * 🦴 *utilities*\n *\n * Merges up to three partial objects, left to right, into one value typed as\n * the intersection of their full types. Re-exported from the\n * [`unpartial`](https://github.com/unional/unpartial) package.\n *\n * The merge is shallow: each source is spread over the previous result, so a\n * later source replaces a nested object instead of merging into it. A key the\n * later source sets to `undefined` overwrites the earlier value. `null` and\n * `undefined` sources are skipped. If `source1` is `null` or `undefined`, it\n * is returned as is.\n *\n * Use `requiredDeep()` to merge nested objects.\n *\n * @example\n * ```ts\n * type Options = { a: number; b: { x: number; y?: number } }\n * const defaults: Options = { a: 1, b: { x: 1, y: 1 } }\n *\n * const r = required<Options>(defaults, { b: { x: 2 } })\n * // r === { a: 1, b: { x: 2 } }\n * // typeof r === Options\n * ```\n */\nexport const required = _required;\n/**\n * 🦴 *utilities*\n *\n * Merges up to three partial objects, left to right and recursively, into one\n * value typed as the intersection of their full types. Re-exported from the\n * [`unpartial`](https://github.com/unional/unpartial) package.\n *\n * Nested objects are merged key by key. An array in a later source replaces\n * the earlier array. A key the later source sets to `undefined` keeps the\n * earlier value. `null` and `undefined` sources are skipped. If `source1` is\n * `null` or `undefined`, it is returned as is.\n *\n * Use `required()` for a shallow merge.\n *\n * @example\n * ```ts\n * type Options = { a: number; b: { x: number; y?: number } }\n * const defaults: Options = { a: 1, b: { x: 1, y: 1 } }\n *\n * const r = requiredDeep<Options>(defaults, { b: { x: 2 } })\n * // r === { a: 1, b: { x: 2, y: 1 } }\n * // typeof r === Options\n * ```\n */\nexport const requiredDeep = _requiredDeep;\n//# sourceMappingURL=unpartial.js.map","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 { unpartial } from 'unpartial'\nimport { consoleFormatter } from './formatter.js'\nimport { logLevels } from './log_levels.js'\nimport { polyfill } from './platform.js'\nimport type { ConsoleLike, LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport function toConsoleMethod(level: number) {\n\tswitch (true) {\n\t\t// edge case in case none is somehow written\n\t\tcase level <= 0:\n\t\t\treturn 'debug'\n\t\tcase level <= logLevels.error:\n\t\t\treturn 'error'\n\t\tcase level <= logLevels.warn:\n\t\t\treturn 'warn'\n\t\tcase level <= logLevels.info:\n\t\t\treturn 'info'\n\t\tdefault:\n\t\t\treturn 'debug'\n\t}\n}\n\n// istanbul ignore next\n/* eslint-disable no-console */\nfunction buildPolyfillConsole() {\n\t// old phantomjs does not have bind function\n\tconst hasBind = !!console.log.bind as boolean\n\tif (hasBind) {\n\t\treturn {\n\t\t\t// the `typeof` guards against IE where `console.log.apply()`\n\t\t\t// results in error `Object doesn't support property or method 'apply'`\n\t\t\tdebug: (typeof console.info === 'function' ? console.debug : console.log).bind(console),\n\t\t\tinfo: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n\t\t\twarn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n\t\t\terror: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n\t\t}\n\t}\n\treturn {\n\t\tdebug: buildFn(typeof console.debug === 'function' ? 'debug' : 'log'),\n\t\tinfo: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n\t\twarn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n\t\terror: buildFn(typeof console.error === 'function' ? 'error' : 'log')\n\t}\n}\n\n// istanbul ignore next\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n\treturn (...args: any[]) => {\n\t\tconsole[name](...args)\n\t}\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\tconst { id, formatter, filter } = unpartial({ id: 'console', formatter: consoleFormatter }, options)\n\tif (!polyfill.console) polyfill.console = buildPolyfillConsole()\n\n\treturn Object.freeze({\n\t\tid,\n\t\tisConsoleReporter: true,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tconsole: polyfill.console,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tconst values = formatter(entry)\n\t\t\tconst method = toConsoleMethod(entry.level)\n\t\t\tthis.console[method](...values)\n\t\t}\n\t})\n}\n","//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n\t\treturn typeof o;\n\t} : function(o) {\n\t\treturn o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n\t}, _typeof(o);\n}\n//#endregion\nexport { _typeof as default };\n","import _typeof from \"./typeof.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n//#endregion\nexport { toPrimitive as default };\n","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n//#endregion\nexport { toPropertyKey as default };\n","import toPropertyKey from \"./toPropertyKey.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n//#endregion\nexport { _defineProperty as default };\n","//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/assertClassBrand.js\nfunction _assertClassBrand(e, t, n) {\n\tif (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n\tthrow new TypeError(\"Private element is not present on this object\");\n}\n//#endregion\nexport { _assertClassBrand as default };\n","import _defineProperty from \"./_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js\";\nimport _assertClassBrand from \"./_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/assertClassBrand.js\";\n//#region ts/index.ts\n// istanbul ignore next\nif (!Error.captureStackTrace) Error.captureStackTrace = (error) => {\n\tconst container = /* @__PURE__ */ new Error();\n\tObject.defineProperty(error, \"stack\", {\n\t\tconfigurable: true,\n\t\tget: function() {\n\t\t\tdefineStack(this, container.stack);\n\t\t\treturn container.stack;\n\t\t},\n\t\tset: (stack) => {\n\t\t\tdefineStack(error, stack);\n\t\t}\n\t});\n};\n// istanbul ignore next\nfunction defineStack(target, value) {\n\tObject.defineProperty(target, \"stack\", {\n\t\tconfigurable: true,\n\t\tvalue,\n\t\twritable: true\n\t});\n}\nvar SerializableConverter = class {\n\tconstructor() {\n\t\t_defineProperty(this, \"plugins\", []);\n\t}\n\taddPlugin(plugin) {\n\t\tthis.plugins.unshift(plugin);\n\t}\n\t/**\n\t* Deserialize an `Error` from `Serializable`\n\t*/\n\tfromSerializable(json, options) {\n\t\tconst err = this.deserializeError(json);\n\t\tError.captureStackTrace(err, options?.ssf);\n\t\treturn err;\n\t}\n\tfromSerializableImpl(json) {\n\t\tif (json[\"name\"] === \"AggregateError\") {\n\t\t\tconst { message, errors, ...rest } = json;\n\t\t\t// istanbul ignore next\n\t\t\tif (global.AggregateError) return Object.assign(new AggregateError(errors, message), rest);\n\t\t\t/* v8 ignore next 4 -- fallback for runtimes without AggregateError */\n\t\t\treturn Object.assign(new Error(message), {\n\t\t\t\t...rest,\n\t\t\t\terrors\n\t\t\t});\n\t\t}\n\t\tconst { message, cause, ...rest } = json;\n\t\tconst causeError = cause ? this.deserializeError(cause) : void 0;\n\t\tif (json[\"name\"] === \"Error\") return Object.assign(new Error(message), causeError ? {\n\t\t\t...rest,\n\t\t\tcause: causeError\n\t\t} : rest);\n\t\treturn Object.assign(new IsoError(message, causeError ? { cause: causeError } : void 0), rest);\n\t}\n\tdeserializeError(json) {\n\t\tlet err;\n\t\tfor (const { fromSerializable } of this.plugins) {\n\t\t\terr = fromSerializable(json);\n\t\t\tif (err) break;\n\t\t}\n\t\treturn err || this.fromSerializableImpl(json);\n\t}\n\t/**\n\t* Serialize `Error` to `Serializable`\n\t*/\n\ttoSerializable(err) {\n\t\treturn this.plugins.reduce((p, s) => p || s.toSerializable(err), void 0) || this.toSerializableImpl(err);\n\t}\n\ttoSerializableImpl(err) {\n\t\tif (isAggregateError(err)) return {\n\t\t\t...err,\n\t\t\tname: err.constructor.name,\n\t\t\tmessage: err.message,\n\t\t\terrors: err.errors.map(this.toSerializableImpl)\n\t\t};\n\t\tif (err instanceof Error) {\n\t\t\tconst { message } = err;\n\t\t\tconst cause = err.cause;\n\t\t\treturn cause ? {\n\t\t\t\t...err,\n\t\t\t\tname: err.constructor.name,\n\t\t\t\tmessage,\n\t\t\t\tcause: this.toSerializableImpl(cause)\n\t\t\t} : {\n\t\t\t\t...err,\n\t\t\t\tname: err.constructor.name,\n\t\t\t\tmessage\n\t\t\t};\n\t\t}\n\t\treturn err;\n\t}\n};\nconst getCircularReplacer = () => {\n\tconst seen = /* @__PURE__ */ new WeakSet();\n\treturn (_, value) => {\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tif (seen.has(value)) return;\n\t\t\tseen.add(value);\n\t\t}\n\t\treturn value;\n\t};\n};\n/**\n* Isomorphic Error that works across physical boundary.\n*/\nvar IsoError = class IsoError extends Error {\n\t/**\n\t* Create an IsoError with additional properties without the need to create a new class.\n\t* @param props properties of the IsoError\n\t*/\n\tstatic create(props) {\n\t\tconst { message, cause, ...rest } = props;\n\t\tconst err = new IsoError(message, {\n\t\t\tcause,\n\t\t\tssf: IsoError.create\n\t\t});\n\t\treturn Object.assign(err, rest);\n\t}\n\tstatic stringify(err) {\n\t\treturn this.serialize(err);\n\t}\n\tstatic serialize(err) {\n\t\treturn JSON.stringify(this.toSerializable(err), getCircularReplacer());\n\t}\n\tstatic toSerializable(err) {\n\t\treturn this.converter.toSerializable(err);\n\t}\n\t/**\n\t* @type P Additional properties of the IsoError\n\t* @param text Json representation of a IsoError\n\t*/\n\tstatic parse(text) {\n\t\tconst json = JSON.parse(text);\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.parse });\n\t}\n\t/**\n\t* @type P Additional properties of the IsoError\n\t* @param text Json representation of a IsoError\n\t*/\n\tstatic deserialize(text) {\n\t\tconst json = JSON.parse(text);\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.deserialize });\n\t}\n\tstatic fromSerializable(json) {\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.fromSerializable });\n\t}\n\t/**\n\t* returns the error message including the error causes.\n\t*/\n\tstatic trace(err) {\n\t\tconst messages = [];\n\t\tif (err instanceof ModuleError) messages.push(`${err.name}(${err.module}): ${err.message}`);\n\t\telse if (err instanceof Error) messages.push(`${err.name}: ${err.message}`);\n\t\tif (isAggregateError(err)) err.errors.forEach((e) => {\n\t\t\tmessages.push(...this.trace(e).split(\"\\n\").map((s) => ` ${s}`));\n\t\t});\n\t\tif (err instanceof Error) {\n\t\t\tif (_assertClassBrand(IsoError, this, _hasCause).call(this, err)) messages.push(...this.trace(err.cause).split(\"\\n\").map((s) => \" \" + s));\n\t\t} else messages.push(typeof err === \"string\" ? err : JSON.stringify(err));\n\t\treturn messages.join(\"\\n\");\n\t}\n\tstatic addPlugin(plugin) {\n\t\tthis.converter.addPlugin(plugin);\n\t}\n\tconstructor(message, options) {\n\t\tsuper(message);\n\t\t_defineProperty(\n\t\t\tthis,\n\t\t\t/**\n\t\t\t* Name of the error\n\t\t\t*/\n\t\t\t\"name\",\n\t\t\tvoid 0\n\t\t);\n\t\t_defineProperty(\n\t\t\tthis,\n\t\t\t/**\n\t\t\t* Error cause\n\t\t\t*/\n\t\t\t\"cause\",\n\t\t\tvoid 0\n\t\t);\n\t\tconst actualProto = new.target.prototype;\n\t\tthis.name = actualProto.constructor.name;\n\t\t// istanbul ignore next\n\t\tif (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto);\n\t\telse this.__proto__ = actualProto;\n\t\tif (options?.cause) this.cause = _toIsoError.call(IsoError, options.cause);\n\t\tif (options?.ssf) Error.captureStackTrace(this, options.ssf);\n\t}\n\ttoString() {\n\t\treturn IsoError.serialize(this);\n\t}\n\ttrace() {\n\t\treturn IsoError.trace(this);\n\t}\n};\nfunction _hasCause(x) {\n\treturn !!x.cause;\n}\nfunction _toIsoError(err) {\n\treturn Object.assign(err, { name: err.name ?? err.constructor.name });\n}\n_defineProperty(IsoError, \"converter\", new SerializableConverter());\n/**\n* An IsoError with a module property.\n*/\nvar ModuleError = class extends IsoError {\n\t/**\n\t* @param module The module that defines this error.\n\t*/\n\tconstructor(module, message, options) {\n\t\tsuper(message, options);\n\t\tthis.module = module;\n\t}\n};\nfunction isAggregateError(error) {\n\treturn error instanceof Error && Array.isArray(error.errors);\n}\n//#endregion\nexport { IsoError, ModuleError, SerializableConverter, isAggregateError };\n\n//# sourceMappingURL=index.js.map","import { type IsoError, ModuleError } from 'iso-error'\n\n/**\n * @deprecated No longer used since 11.2.0\n */\nexport class StandardLogError extends ModuleError {\n\tconstructor(description: string, options?: IsoError.Options) {\n\t\tsuper('standard-log', description, options)\n\t}\n}\n\n/**\n * @deprecated no longer used since 11.2.0\n */\nexport class InvalidId extends StandardLogError {\n\tconstructor(\n\t\tpublic id: string,\n\t\toptions?: IsoError.Options\n\t) {\n\t\tsuper(`logger id only supports alphanumeric, unicode characters, and [:_-.]. Received ${id}`, options)\n\t}\n}\n","import { required } from 'type-plus'\nimport { unpartial } from 'unpartial'\nimport { createConsoleLogReporter } from './console.js'\nimport { formatLogLevel } from './formatter.js'\nimport { toInspectLogEntry } from './platform.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n\tlogs: LogEntry[]\n\t/**\n\t * Gets a simple log message for testing.\n\t * The message only contains arguments for each log entry.\n\t */\n\tgetLogMessage(): string\n\tgetLogMessages(): string[]\n\tgetLogMessageWithLevel(): string\n\tgetLogMessagesWithLevel(): string[]\n\tgetLogMessagesWithIdAndLevel(): string[]\n\temit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n\treturn (\n\t\tlogs\n\t\t\t.map(toInspectLogEntry)\n\t\t\t.map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t\t.join('\\n')\n\t\t\t// if it has more than this log,\n\t\t\t// we assume it is running under tests,\n\t\t\t// and remove this log to simplify testing.\n\t\t\t.replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n\t)\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n\treturn Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n\tconst { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n\tconst logs: LogEntry[] = []\n\treturn {\n\t\tid,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tlogs,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tlogs.push(formatter(entry))\n\t\t},\n\t\tgetLogMessage() {\n\t\t\treturn this.getLogMessages().join('\\n')\n\t\t},\n\t\tgetLogMessages() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => log.args.join(' '))\n\t\t},\n\t\tgetLogMessagesWithLevel() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessagesWithIdAndLevel() {\n\t\t\treturn logs\n\t\t\t\t.map(toInspectLogEntry)\n\t\t\t\t.map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessageWithLevel() {\n\t\t\treturn toMessageWithLevel(logs)\n\t\t},\n\t\t/**\n\t\t * emit the saved log to console for easy debugging\n\t\t */\n\t\temit() {\n\t\t\tconst reporter = createConsoleLogReporter()\n\t\t\tlogs.forEach(l => reporter.write(l))\n\t\t}\n\t}\n}\n\nexport function createMemoryWithConsoleLogReporter(\n\toptions?: LogReporterOptions<LogEntry>\n): MemoryLogReporter {\n\treturn Object.freeze(\n\t\tObject.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n\t\t\tisConsoleReporter: true\n\t\t})\n\t)\n}\n","import { mapKey, record, reduceByKey } from 'type-plus'\nimport { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './log_levels.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(\n\toptions: Required<StandardLogOptions<N>>\n): LogStore {\n\treturn {\n\t\tloggers: record(),\n\t\tnonConsoleLoggers: record(),\n\t\treporters: options.reporters || [createConsoleLogReporter()],\n\t\tlogLevel: options.logLevel,\n\t\tlogLevelStore: logLevelStore(options)\n\t}\n}\n\nexport interface LogStore {\n\tloggers: Record<string, Logger>\n\tnonConsoleLoggers: Record<string, Logger>\n\treporters: LogReporter[]\n\tlogLevel: LogLevel\n\tlogLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n\tcustomLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n\tconst customLevels = options.customLevels || record()\n\n\tconst store = {\n\t\tcustomLevels,\n\t\tcustomLevelsReverse: reduceByKey(\n\t\t\tcustomLevels,\n\t\t\t(p, k) => {\n\t\t\t\tp[customLevels[k]] = k\n\t\t\t\treturn p\n\t\t\t},\n\t\t\t{} as Record<number, string>\n\t\t)\n\t}\n\treturn {\n\t\tgetName(level: number) {\n\t\t\treturn store.customLevelsReverse[level] ?? toLogLevelName(level)\n\t\t},\n\t\tgetLevel(name: string) {\n\t\t\treturn store.customLevels[name] ?? toLogLevel(name)\n\t\t},\n\t\tgetAllLevels() {\n\t\t\treturn reduceByKey(\n\t\t\t\tlogLevels,\n\t\t\t\t(result, name) => {\n\t\t\t\t\tif (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n\t\t\t\t\treturn result\n\t\t\t\t},\n\t\t\t\tmapKey(store.customLevels, name => ({ name, level: store.customLevels[name] }))\n\t\t\t)\n\t\t}\n\t}\n}\n","import { logLevels } from './log_levels.js'\nimport type { LogStore } from './log_store.js'\nimport type {\n\tLogEntry,\n\tLogFunction,\n\tLogger,\n\tLoggerOptions,\n\tLogLevel,\n\tLogMethodNames,\n\tLogReporter\n} from './types.js'\n\nexport function createLogger<N extends string = LogMethodNames>(\n\tstore: LogStore,\n\tid: string,\n\toptions?: LoggerOptions\n): Logger<N | LogMethodNames> {\n\tid = sanitizeId(id)\n\tconst writeTo = options?.writeTo ?? (() => true)\n\tconst [filter, reporters]: [(reporterId: string) => boolean, LogReporter[]] =\n\t\ttypeof writeTo === 'string'\n\t\t\t? [id => id === writeTo, store.reporters]\n\t\t\t: writeTo instanceof RegExp\n\t\t\t\t? [id => writeTo.test(id), store.reporters]\n\t\t\t\t: typeof writeTo === 'function'\n\t\t\t\t\t? [writeTo, store.reporters]\n\t\t\t\t\t: [() => true, [writeTo]]\n\n\tfunction write(entry: LogEntry) {\n\t\twriteToReporters(reporters, entry, filter)\n\t}\n\n\tconst logger = {\n\t\tlevel: options?.level,\n\t\twrite\n\t} as any\n\n\tObject.defineProperties(logger, {\n\t\tid: { value: id, writable: false },\n\t\tcount: {\n\t\t\twritable: false,\n\t\t\tvalue: (\n\t\t\t\tcounter =>\n\t\t\t\t(...args: any[]): void => {\n\t\t\t\t\tif (shouldLog(store, logLevels.debug, logger.level))\n\t\t\t\t\t\twrite({\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tlevel: logLevels.debug,\n\t\t\t\t\t\t\targs: [++counter, ...args],\n\t\t\t\t\t\t\ttimestamp: new Date()\n\t\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t)(0)\n\t\t},\n\t\ton: {\n\t\t\twritable: false,\n\t\t\tvalue: (level: number | N | LogMethodNames, logFn: LogFunction) => {\n\t\t\t\tconst logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level)! : level\n\t\t\t\tif (shouldLog(store, logLevel, logger.level)) {\n\t\t\t\t\tconst methodName = store.logLevelStore.getName(logLevel)\n\t\t\t\t\tconst bindedMethod = logger[methodName].bind(logger)\n\t\t\t\t\tconst result = logFn(bindedMethod, logger.level ?? store.logLevel)\n\t\t\t\t\tif (result) bindedMethod(result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\tstore.logLevelStore.getAllLevels().forEach(function addMethod({ name, level }) {\n\t\tObject.defineProperty(logger, name, {\n\t\t\twritable: false,\n\t\t\tvalue: (...args: any[]) => {\n\t\t\t\tif (shouldLog(store, level, logger.level)) write({ id, level, args, timestamp: new Date() })\n\t\t\t}\n\t\t})\n\t})\n\treturn logger\n}\n\nfunction sanitizeId(id: string) {\n\treturn id.replace(/[`~!#$%^&*()=+[\\]{},|<>?]/g, '-')\n}\n\nfunction writeToReporters(\n\treporters: LogReporter[],\n\tlogEntry: LogEntry,\n\tfilter: (reporterId: string) => boolean\n) {\n\treporters.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\treturn targetLevel <= (loggerLevel !== undefined ? loggerLevel : store.logLevel)\n}\n","import { record } from 'type-plus'\nimport type { LogStore } from './log_store.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n\tconfigured?: boolean\n\tgsl?: { store: LogStore; standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n","import { record, required } from 'type-plus'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './log_levels.js'\nimport { createLogStore, type LogStore } from './log_store.js'\nimport { createLogger } from './logger.js'\nimport { ctx } from './standard_log.ctx.js'\nimport type {\n\tLogger,\n\tLoggerOptions,\n\tLogMethodNames,\n\tStandardLogInstance,\n\tStandardLogOptions\n} from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): StandardLog<N> {\n\tconst closure = createStandardLogClosure(options)\n\tif (options?.reporters?.some(r => !r.id)) {\n\t\tconst log = closure.standardLog.getLogger('standard-log')\n\t\tlog.critical(\n\t\t\t`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\t\t)\n\t}\n\n\tif (!ctx.gsl) ctx.gsl = closure as any\n\treturn closure.standardLog\n}\n\nfunction noop() {}\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): { store: LogStore; standardLog: StandardLog<N> } {\n\t// TODO reporter.id must not be empty\n\tconst store = createLogStore(required({ logLevel: logLevels.info }, options))\n\tconst nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n\tconst logMethods = DEFAULT_LOG_METHOD_NAMES.concat(Object.keys(options?.customLevels ?? {})).concat([\n\t\t'on',\n\t\t'count',\n\t\t'write'\n\t])\n\treturn {\n\t\tstore,\n\t\tstandardLog: {\n\t\t\tget logLevel() {\n\t\t\t\treturn store.logLevel\n\t\t\t},\n\n\t\t\ttoLogLevelName(level: number) {\n\t\t\t\treturn store.logLevelStore.getName(level)\n\t\t\t},\n\t\t\ttoLogLevel(name: string) {\n\t\t\t\treturn store.logLevelStore.getLevel(name)\n\t\t\t},\n\t\t\tgetLogger(id: string, options?: LoggerOptions) {\n\t\t\t\tif (store.loggers[id]) return store.loggers[id] as any\n\t\t\t\treturn (store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any)\n\t\t\t},\n\t\t\tgetNonConsoleLogger(id, options?) {\n\t\t\t\tif (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n\t\t\t\tif (store.loggers[id]) {\n\t\t\t\t\tconst log = this.getLogger('standard-log')\n\t\t\t\t\tlog.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n\t\t\t\t\treturn (store.nonConsoleLoggers[id] = createDummyLogger(logMethods))\n\t\t\t\t}\n\n\t\t\t\treturn (store.nonConsoleLoggers[id] =\n\t\t\t\t\tnonConsoleReporters.length === 0\n\t\t\t\t\t\t? createDummyLogger(logMethods)\n\t\t\t\t\t\t: createLogger(store, id, {\n\t\t\t\t\t\t\t\tssf: this.getNonConsoleLogger,\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\twriteTo(reporterId) {\n\t\t\t\t\t\t\t\t\treturn nonConsoleReporters.indexOf(reporterId) >= 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n\treturn logMethods.reduce((p, m) => {\n\t\tp[m] = noop\n\t\treturn p\n\t}, record()) as Logger\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\tconst origLevels = logs.map(l => l.level)\n\tlogs.forEach(l => (l.level = logLevels.none))\n\tconst result = block()\n\tlogs.forEach((l, i) => (l.level = origLevels[i]))\n\treturn result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (\n\tid: string,\n\toptions?: LoggerOptions\n) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n\treturn getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n\tif (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n\treturn ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n\tif (ctx.configured) {\n\t\tconst log = ctx.gsl!.standardLog.getLogger('standard-log')\n\t\tlog.warn(\n\t\t\t'configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.'\n\t\t)\n\t}\n\n\tif (ctx.gsl) {\n\t\tif (options.logLevel) {\n\t\t\tctx.gsl.store.logLevel = options.logLevel\n\t\t}\n\t\tif (options.reporters) {\n\t\t\tconst reporters = ctx.gsl.store.reporters\n\t\t\treporters.length = 0\n\t\t\treporters.push(...options.reporters)\n\t\t}\n\t} else {\n\t\tctx.gsl = createStandardLogClosure(options)\n\t}\n\tctx.configured = true\n}\n"],"x_google_ignoreList":[0,1,4,5,6,7,8,11,12,13,14,15,16],"mappings":";;;;;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;GACpC;EACD,OACC,IAAI,MAAM,yBAAyB,OAAO;EAE3C,IAAI,aAAa;CAClB"}
1
+ {"version":3,"file":"standard-log.iife.js","names":["ms"],"sources":["../../../node_modules/.pnpm/unpartial@1.0.8/node_modules/unpartial/esm/index.js","../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","../ts/log_levels.ts","../ts/formatter.ts","../ts/record.ts","../ts/platform.browser.ts","../ts/console.ts","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/typeof.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPrimitive.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPropertyKey.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/assertClassBrand.js","../../../node_modules/.pnpm/iso-error@7.0.0/node_modules/iso-error/esm/index.js","../ts/errors.ts","../ts/memory.ts","../ts/log_store.ts","../ts/logger.ts","../ts/standard_log.ctx.ts","../ts/standard_log.ts"],"sourcesContent":["//#region ts/index.ts\nfunction required(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => {\n\t\treturn {\n\t\t\t...p,\n\t\t\t...e\n\t\t};\n\t});\n}\nfunction requiredDeep(source1, source2, source3) {\n\treturn merge([\n\t\tsource1,\n\t\tsource2,\n\t\tsource3\n\t], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n\tif (entries[0] === void 0 || entries[0] === null) return entries[0];\n\treturn entries.filter((x) => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n\tif (typeof source1 !== \"object\" || source1 === null) return source2 !== void 0 ? source2 : source1;\n\tif (Array.isArray(source1)) {\n\t\tif (Array.isArray(source2)) return source2;\n\t\tif (source2 === void 0) return [...source1];\n\t\treturn [...source1, source2];\n\t}\n\treturn getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n\t\tp[k] = deepmerge(source1[k], source2 && source2[k]);\n\t\treturn p;\n\t}, {});\n}\nfunction getAllKeys(subject, internal = false) {\n\tif (typeof subject !== \"object\") return [];\n\tconst propertyNames = Object.getOwnPropertyNames(subject);\n\tconst keys = internal ? propertyNames.filter((n) => n !== \"constructor\") : propertyNames;\n\tconst proto = Object.getPrototypeOf(subject);\n\treturn proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nfunction unpartial(s1, s2, s3) {\n\tif (s1 === void 0 || s1 === null) return s1;\n\treturn [\n\t\ts1,\n\t\ts2,\n\t\ts3\n\t].filter(notNil).reduce((p, s) => ({\n\t\t...p,\n\t\t...trimNilProps(s)\n\t}), {});\n}\nfunction trimNilProps(value) {\n\treturn Object.keys(value).reduce((p, k) => {\n\t\tif (notNil(value[k])) p[k] = value[k];\n\t\treturn p;\n\t}, {});\n}\nfunction notNil(value) {\n\treturn value !== null && value !== void 0;\n}\nfunction unpartialRecursively(arg1, arg2, arg3) {\n\treturn requiredDeep(arg1, arg2, arg3);\n}\n//#endregion\nexport { required, requiredDeep, unpartial, unpartialRecursively };\n\n//# sourceMappingURL=index.js.map","/**\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","export const logLevels = {\n\t/**\n\t * none: 0\n\t */\n\tnone: 0 as const,\n\t/**\n\t * emergency: 100\n\t *\n\t * emergency -> alert\n\t */\n\temergency: 100 as const,\n\t/**\n\t * alert: 200\n\t *\n\t * emergency -> alert -> critical\n\t */\n\talert: 200 as const,\n\t/**\n\t * critical: 300\n\t *\n\t * alert -> critical -> error\n\t */\n\tcritical: 300 as const,\n\t/**\n\t * error: 400\n\t *\n\t * critical -> error -> warn\n\t */\n\terror: 400 as const,\n\t/**\n\t * warn: 500\n\t *\n\t * error -> warn -> notice\n\t */\n\twarn: 500 as const,\n\t/**\n\t * notice: 600\n\t *\n\t * warn -> notice -> info\n\t */\n\tnotice: 600 as const,\n\t/**\n\t * info: 700\n\t *\n\t * notice -> info -> debug\n\t */\n\tinfo: 700 as const,\n\t/**\n\t * debug: 800\n\t *\n\t * info -> debug -> trace\n\t */\n\tdebug: 800 as const,\n\t/**\n\t * trace: 900\n\t *\n\t * debug -> trace -> planck\n\t */\n\ttrace: 900 as const,\n\t/**\n\t * planck: Infinity\n\t * `planck unit` is a very small unit <https://en.wikipedia.org/wiki/Planck_units>.\n\t *\n\t * trace -> planck\n\t */\n\tplanck: Number.POSITIVE_INFINITY,\n\t/**\n\t * all: Infinity\n\t */\n\tall: Number.POSITIVE_INFINITY\n}\n\n/**\n * Convert default log level value to log level name.\n */\nexport function toLogLevelName(level: number) {\n\tif (level <= 100) return 'emergency'\n\tif (level <= 200) return 'alert'\n\tif (level <= 300) return 'critical'\n\tif (level <= 400) return 'error'\n\tif (level <= 500) return 'warn'\n\tif (level <= 600) return 'notice'\n\tif (level <= 700) return 'info'\n\tif (level <= 800) return 'debug'\n\tif (level <= 900) return 'trace'\n\treturn 'planck'\n}\n\n/**\n * Convert default log level name to log level value.\n */\nexport function toLogLevel(name: string): number | undefined {\n\treturn (logLevels as any)[name.toLocaleLowerCase()]\n}\n\nexport const DEFAULT_LOG_METHOD_NAMES: string[] = [\n\t'emergency',\n\t'alert',\n\t'critical',\n\t'error',\n\t'warn',\n\t'notice',\n\t'info',\n\t'debug',\n\t'trace',\n\t'planck'\n]\n","import ms from 'ms'\nimport { toLogLevelName } from './log_levels.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\tswitch (format) {\n\t\tcase 'none':\n\t\t\treturn (_timestamp: Date) => undefined\n\t\tcase 'iso':\n\t\t\treturn (timestamp: Date) => timestamp.toISOString()\n\t\tcase 'elapsed': {\n\t\t\tlet lastTick: number\n\t\t\treturn (timestamp: Date) => {\n\t\t\t\tconst newTick = timestamp.getTime()\n\t\t\t\tconst result = ms(lastTick === undefined ? 0 : newTick - lastTick)\n\t\t\t\tlastTick = newTick\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function formatLogLevel(level: number) {\n\treturn `(${toLogLevelName(level).toUpperCase()})`\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\treturn [timestamp.toISOString(), id, formatLogLevel(level), ...args]\n}\n\n/**\n * Formats log entry like default console log.\n */\nexport function consoleFormatter({ args }: LogEntry) {\n\treturn args\n}\n","/**\n * Creates a prototype-less object, optionally seeded with `value`.\n *\n * Inlined from `type-plus` so the CJS build does not `require()` the ESM-only `type-plus`.\n */\nexport function record<R extends Record<any, any>>(value?: R): R {\n\tconst r = Object.create(null)\n\treturn value ? Object.assign(r, value) : r\n}\n","import { record } from './record.js'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => e\n\nexport const polyfill: { console?: ConsoleLike } = record()\n","import { unpartial } from 'unpartial'\nimport { consoleFormatter } from './formatter.js'\nimport { logLevels } from './log_levels.js'\nimport { polyfill } from './platform.js'\nimport type { ConsoleLike, LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport function toConsoleMethod(level: number) {\n\tswitch (true) {\n\t\t// edge case in case none is somehow written\n\t\tcase level <= 0:\n\t\t\treturn 'debug'\n\t\tcase level <= logLevels.error:\n\t\t\treturn 'error'\n\t\tcase level <= logLevels.warn:\n\t\t\treturn 'warn'\n\t\tcase level <= logLevels.info:\n\t\t\treturn 'info'\n\t\tdefault:\n\t\t\treturn 'debug'\n\t}\n}\n\n// istanbul ignore next\n/* eslint-disable no-console */\nfunction buildPolyfillConsole() {\n\t// old phantomjs does not have bind function\n\tconst hasBind = !!console.log.bind as boolean\n\tif (hasBind) {\n\t\treturn {\n\t\t\t// the `typeof` guards against IE where `console.log.apply()`\n\t\t\t// results in error `Object doesn't support property or method 'apply'`\n\t\t\tdebug: (typeof console.info === 'function' ? console.debug : console.log).bind(console),\n\t\t\tinfo: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n\t\t\twarn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n\t\t\terror: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n\t\t}\n\t}\n\treturn {\n\t\tdebug: buildFn(typeof console.debug === 'function' ? 'debug' : 'log'),\n\t\tinfo: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n\t\twarn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n\t\terror: buildFn(typeof console.error === 'function' ? 'error' : 'log')\n\t}\n}\n\n// istanbul ignore next\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n\treturn (...args: any[]) => {\n\t\tconsole[name](...args)\n\t}\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\tconst { id, formatter, filter } = unpartial({ id: 'console', formatter: consoleFormatter }, options)\n\tif (!polyfill.console) polyfill.console = buildPolyfillConsole()\n\n\treturn Object.freeze({\n\t\tid,\n\t\tisConsoleReporter: true,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tconsole: polyfill.console,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tconst values = formatter(entry)\n\t\t\tconst method = toConsoleMethod(entry.level)\n\t\t\tthis.console[method](...values)\n\t\t}\n\t})\n}\n","//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n\t\treturn typeof o;\n\t} : function(o) {\n\t\treturn o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n\t}, _typeof(o);\n}\n//#endregion\nexport { _typeof as default };\n","import _typeof from \"./typeof.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n//#endregion\nexport { toPrimitive as default };\n","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n//#endregion\nexport { toPropertyKey as default };\n","import toPropertyKey from \"./toPropertyKey.js\";\n//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n//#endregion\nexport { _defineProperty as default };\n","//#region \\0@oxc-project+runtime@0.147.0/helpers/esm/assertClassBrand.js\nfunction _assertClassBrand(e, t, n) {\n\tif (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n\tthrow new TypeError(\"Private element is not present on this object\");\n}\n//#endregion\nexport { _assertClassBrand as default };\n","import _defineProperty from \"./_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js\";\nimport _assertClassBrand from \"./_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/assertClassBrand.js\";\n//#region ts/index.ts\n// istanbul ignore next\nif (!Error.captureStackTrace) Error.captureStackTrace = (error) => {\n\tconst container = /* @__PURE__ */ new Error();\n\tObject.defineProperty(error, \"stack\", {\n\t\tconfigurable: true,\n\t\tget: function() {\n\t\t\tdefineStack(this, container.stack);\n\t\t\treturn container.stack;\n\t\t},\n\t\tset: (stack) => {\n\t\t\tdefineStack(error, stack);\n\t\t}\n\t});\n};\n// istanbul ignore next\nfunction defineStack(target, value) {\n\tObject.defineProperty(target, \"stack\", {\n\t\tconfigurable: true,\n\t\tvalue,\n\t\twritable: true\n\t});\n}\nvar SerializableConverter = class {\n\tconstructor() {\n\t\t_defineProperty(this, \"plugins\", []);\n\t}\n\taddPlugin(plugin) {\n\t\tthis.plugins.unshift(plugin);\n\t}\n\t/**\n\t* Deserialize an `Error` from `Serializable`\n\t*/\n\tfromSerializable(json, options) {\n\t\tconst err = this.deserializeError(json);\n\t\tError.captureStackTrace(err, options?.ssf);\n\t\treturn err;\n\t}\n\tfromSerializableImpl(json) {\n\t\tif (json[\"name\"] === \"AggregateError\") {\n\t\t\tconst { message, errors, ...rest } = json;\n\t\t\t// istanbul ignore next\n\t\t\tif (global.AggregateError) return Object.assign(new AggregateError(errors, message), rest);\n\t\t\t/* v8 ignore next 4 -- fallback for runtimes without AggregateError */\n\t\t\treturn Object.assign(new Error(message), {\n\t\t\t\t...rest,\n\t\t\t\terrors\n\t\t\t});\n\t\t}\n\t\tconst { message, cause, ...rest } = json;\n\t\tconst causeError = cause ? this.deserializeError(cause) : void 0;\n\t\tif (json[\"name\"] === \"Error\") return Object.assign(new Error(message), causeError ? {\n\t\t\t...rest,\n\t\t\tcause: causeError\n\t\t} : rest);\n\t\treturn Object.assign(new IsoError(message, causeError ? { cause: causeError } : void 0), rest);\n\t}\n\tdeserializeError(json) {\n\t\tlet err;\n\t\tfor (const { fromSerializable } of this.plugins) {\n\t\t\terr = fromSerializable(json);\n\t\t\tif (err) break;\n\t\t}\n\t\treturn err || this.fromSerializableImpl(json);\n\t}\n\t/**\n\t* Serialize `Error` to `Serializable`\n\t*/\n\ttoSerializable(err) {\n\t\treturn this.plugins.reduce((p, s) => p || s.toSerializable(err), void 0) || this.toSerializableImpl(err);\n\t}\n\ttoSerializableImpl(err) {\n\t\tif (isAggregateError(err)) return {\n\t\t\t...err,\n\t\t\tname: err.constructor.name,\n\t\t\tmessage: err.message,\n\t\t\terrors: err.errors.map(this.toSerializableImpl)\n\t\t};\n\t\tif (err instanceof Error) {\n\t\t\tconst { message } = err;\n\t\t\tconst cause = err.cause;\n\t\t\treturn cause ? {\n\t\t\t\t...err,\n\t\t\t\tname: err.constructor.name,\n\t\t\t\tmessage,\n\t\t\t\tcause: this.toSerializableImpl(cause)\n\t\t\t} : {\n\t\t\t\t...err,\n\t\t\t\tname: err.constructor.name,\n\t\t\t\tmessage\n\t\t\t};\n\t\t}\n\t\treturn err;\n\t}\n};\nconst getCircularReplacer = () => {\n\tconst seen = /* @__PURE__ */ new WeakSet();\n\treturn (_, value) => {\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tif (seen.has(value)) return;\n\t\t\tseen.add(value);\n\t\t}\n\t\treturn value;\n\t};\n};\n/**\n* Isomorphic Error that works across physical boundary.\n*/\nvar IsoError = class IsoError extends Error {\n\t/**\n\t* Create an IsoError with additional properties without the need to create a new class.\n\t* @param props properties of the IsoError\n\t*/\n\tstatic create(props) {\n\t\tconst { message, cause, ...rest } = props;\n\t\tconst err = new IsoError(message, {\n\t\t\tcause,\n\t\t\tssf: IsoError.create\n\t\t});\n\t\treturn Object.assign(err, rest);\n\t}\n\tstatic stringify(err) {\n\t\treturn this.serialize(err);\n\t}\n\tstatic serialize(err) {\n\t\treturn JSON.stringify(this.toSerializable(err), getCircularReplacer());\n\t}\n\tstatic toSerializable(err) {\n\t\treturn this.converter.toSerializable(err);\n\t}\n\t/**\n\t* @type P Additional properties of the IsoError\n\t* @param text Json representation of a IsoError\n\t*/\n\tstatic parse(text) {\n\t\tconst json = JSON.parse(text);\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.parse });\n\t}\n\t/**\n\t* @type P Additional properties of the IsoError\n\t* @param text Json representation of a IsoError\n\t*/\n\tstatic deserialize(text) {\n\t\tconst json = JSON.parse(text);\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.deserialize });\n\t}\n\tstatic fromSerializable(json) {\n\t\treturn this.converter.fromSerializable(json, { ssf: IsoError.fromSerializable });\n\t}\n\t/**\n\t* returns the error message including the error causes.\n\t*/\n\tstatic trace(err) {\n\t\tconst messages = [];\n\t\tif (err instanceof ModuleError) messages.push(`${err.name}(${err.module}): ${err.message}`);\n\t\telse if (err instanceof Error) messages.push(`${err.name}: ${err.message}`);\n\t\tif (isAggregateError(err)) err.errors.forEach((e) => {\n\t\t\tmessages.push(...this.trace(e).split(\"\\n\").map((s) => ` ${s}`));\n\t\t});\n\t\tif (err instanceof Error) {\n\t\t\tif (_assertClassBrand(IsoError, this, _hasCause).call(this, err)) messages.push(...this.trace(err.cause).split(\"\\n\").map((s) => \" \" + s));\n\t\t} else messages.push(typeof err === \"string\" ? err : JSON.stringify(err));\n\t\treturn messages.join(\"\\n\");\n\t}\n\tstatic addPlugin(plugin) {\n\t\tthis.converter.addPlugin(plugin);\n\t}\n\tconstructor(message, options) {\n\t\tsuper(message);\n\t\t_defineProperty(\n\t\t\tthis,\n\t\t\t/**\n\t\t\t* Name of the error\n\t\t\t*/\n\t\t\t\"name\",\n\t\t\tvoid 0\n\t\t);\n\t\t_defineProperty(\n\t\t\tthis,\n\t\t\t/**\n\t\t\t* Error cause\n\t\t\t*/\n\t\t\t\"cause\",\n\t\t\tvoid 0\n\t\t);\n\t\tconst actualProto = new.target.prototype;\n\t\tthis.name = actualProto.constructor.name;\n\t\t// istanbul ignore next\n\t\tif (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto);\n\t\telse this.__proto__ = actualProto;\n\t\tif (options?.cause) this.cause = _toIsoError.call(IsoError, options.cause);\n\t\tif (options?.ssf) Error.captureStackTrace(this, options.ssf);\n\t}\n\ttoString() {\n\t\treturn IsoError.serialize(this);\n\t}\n\ttrace() {\n\t\treturn IsoError.trace(this);\n\t}\n};\nfunction _hasCause(x) {\n\treturn !!x.cause;\n}\nfunction _toIsoError(err) {\n\treturn Object.assign(err, { name: err.name ?? err.constructor.name });\n}\n_defineProperty(IsoError, \"converter\", new SerializableConverter());\n/**\n* An IsoError with a module property.\n*/\nvar ModuleError = class extends IsoError {\n\t/**\n\t* @param module The module that defines this error.\n\t*/\n\tconstructor(module, message, options) {\n\t\tsuper(message, options);\n\t\tthis.module = module;\n\t}\n};\nfunction isAggregateError(error) {\n\treturn error instanceof Error && Array.isArray(error.errors);\n}\n//#endregion\nexport { IsoError, ModuleError, SerializableConverter, isAggregateError };\n\n//# sourceMappingURL=index.js.map","import { type IsoError, ModuleError } from 'iso-error'\n\n/**\n * @deprecated No longer used since 11.2.0\n */\nexport class StandardLogError extends ModuleError {\n\tconstructor(description: string, options?: IsoError.Options) {\n\t\tsuper('standard-log', description, options)\n\t}\n}\n\n/**\n * @deprecated no longer used since 11.2.0\n */\nexport class InvalidId extends StandardLogError {\n\tconstructor(\n\t\tpublic id: string,\n\t\toptions?: IsoError.Options\n\t) {\n\t\tsuper(`logger id only supports alphanumeric, unicode characters, and [:_-.]. Received ${id}`, options)\n\t}\n}\n","import { required, unpartial } from 'unpartial'\nimport { createConsoleLogReporter } from './console.js'\nimport { formatLogLevel } from './formatter.js'\nimport { toInspectLogEntry } from './platform.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n\tlogs: LogEntry[]\n\t/**\n\t * Gets a simple log message for testing.\n\t * The message only contains arguments for each log entry.\n\t */\n\tgetLogMessage(): string\n\tgetLogMessages(): string[]\n\tgetLogMessageWithLevel(): string\n\tgetLogMessagesWithLevel(): string[]\n\tgetLogMessagesWithIdAndLevel(): string[]\n\temit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n\treturn (\n\t\tlogs\n\t\t\t.map(toInspectLogEntry)\n\t\t\t.map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t\t.join('\\n')\n\t\t\t// if it has more than this log,\n\t\t\t// we assume it is running under tests,\n\t\t\t// and remove this log to simplify testing.\n\t\t\t.replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n\t)\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n\treturn Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n\tconst { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n\tconst logs: LogEntry[] = []\n\treturn {\n\t\tid,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tlogs,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tlogs.push(formatter(entry))\n\t\t},\n\t\tgetLogMessage() {\n\t\t\treturn this.getLogMessages().join('\\n')\n\t\t},\n\t\tgetLogMessages() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => log.args.join(' '))\n\t\t},\n\t\tgetLogMessagesWithLevel() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessagesWithIdAndLevel() {\n\t\t\treturn logs\n\t\t\t\t.map(toInspectLogEntry)\n\t\t\t\t.map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessageWithLevel() {\n\t\t\treturn toMessageWithLevel(logs)\n\t\t},\n\t\t/**\n\t\t * emit the saved log to console for easy debugging\n\t\t */\n\t\temit() {\n\t\t\tconst reporter = createConsoleLogReporter()\n\t\t\tlogs.forEach(l => reporter.write(l))\n\t\t}\n\t}\n}\n\nexport function createMemoryWithConsoleLogReporter(\n\toptions?: LogReporterOptions<LogEntry>\n): MemoryLogReporter {\n\treturn Object.freeze(\n\t\tObject.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n\t\t\tisConsoleReporter: true\n\t\t})\n\t)\n}\n","import { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './log_levels.js'\nimport { record } from './record.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(\n\toptions: Required<StandardLogOptions<N>>\n): LogStore {\n\treturn {\n\t\tloggers: record(),\n\t\tnonConsoleLoggers: record(),\n\t\treporters: options.reporters || [createConsoleLogReporter()],\n\t\tlogLevel: options.logLevel,\n\t\tlogLevelStore: logLevelStore(options)\n\t}\n}\n\nexport interface LogStore {\n\tloggers: Record<string, Logger>\n\tnonConsoleLoggers: Record<string, Logger>\n\treporters: LogReporter[]\n\tlogLevel: LogLevel\n\tlogLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n\tcustomLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n\tconst customLevels = options.customLevels || record()\n\n\tconst store = {\n\t\tcustomLevels,\n\t\tcustomLevelsReverse: Object.keys(customLevels).reduce(\n\t\t\t(p, k) => {\n\t\t\t\tp[customLevels[k]] = k\n\t\t\t\treturn p\n\t\t\t},\n\t\t\t{} as Record<number, string>\n\t\t)\n\t}\n\treturn {\n\t\tgetName(level: number) {\n\t\t\treturn store.customLevelsReverse[level] ?? toLogLevelName(level)\n\t\t},\n\t\tgetLevel(name: string) {\n\t\t\treturn store.customLevels[name] ?? toLogLevel(name)\n\t\t},\n\t\tgetAllLevels() {\n\t\t\treturn (Object.keys(logLevels) as Array<keyof typeof logLevels>).reduce(\n\t\t\t\t(result, name) => {\n\t\t\t\t\tif (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n\t\t\t\t\treturn result\n\t\t\t\t},\n\t\t\t\tObject.keys(store.customLevels).map(name => ({ name, level: store.customLevels[name] }))\n\t\t\t)\n\t\t}\n\t}\n}\n","import { logLevels } from './log_levels.js'\nimport type { LogStore } from './log_store.js'\nimport type {\n\tLogEntry,\n\tLogFunction,\n\tLogger,\n\tLoggerOptions,\n\tLogLevel,\n\tLogMethodNames,\n\tLogReporter\n} from './types.js'\n\nexport function createLogger<N extends string = LogMethodNames>(\n\tstore: LogStore,\n\tid: string,\n\toptions?: LoggerOptions\n): Logger<N | LogMethodNames> {\n\tid = sanitizeId(id)\n\tconst writeTo = options?.writeTo ?? (() => true)\n\tconst [filter, reporters]: [(reporterId: string) => boolean, LogReporter[]] =\n\t\ttypeof writeTo === 'string'\n\t\t\t? [id => id === writeTo, store.reporters]\n\t\t\t: writeTo instanceof RegExp\n\t\t\t\t? [id => writeTo.test(id), store.reporters]\n\t\t\t\t: typeof writeTo === 'function'\n\t\t\t\t\t? [writeTo, store.reporters]\n\t\t\t\t\t: [() => true, [writeTo]]\n\n\tfunction write(entry: LogEntry) {\n\t\twriteToReporters(reporters, entry, filter)\n\t}\n\n\tconst logger = {\n\t\tlevel: options?.level,\n\t\twrite\n\t} as any\n\n\tObject.defineProperties(logger, {\n\t\tid: { value: id, writable: false },\n\t\tcount: {\n\t\t\twritable: false,\n\t\t\tvalue: (\n\t\t\t\tcounter =>\n\t\t\t\t(...args: any[]): void => {\n\t\t\t\t\tif (shouldLog(store, logLevels.debug, logger.level))\n\t\t\t\t\t\twrite({\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tlevel: logLevels.debug,\n\t\t\t\t\t\t\targs: [++counter, ...args],\n\t\t\t\t\t\t\ttimestamp: new Date()\n\t\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t)(0)\n\t\t},\n\t\ton: {\n\t\t\twritable: false,\n\t\t\tvalue: (level: number | N | LogMethodNames, logFn: LogFunction) => {\n\t\t\t\tconst logLevel = typeof level === 'string' ? store.logLevelStore.getLevel(level)! : level\n\t\t\t\tif (shouldLog(store, logLevel, logger.level)) {\n\t\t\t\t\tconst methodName = store.logLevelStore.getName(logLevel)\n\t\t\t\t\tconst bindedMethod = logger[methodName].bind(logger)\n\t\t\t\t\tconst result = logFn(bindedMethod, logger.level ?? store.logLevel)\n\t\t\t\t\tif (result) bindedMethod(result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\tstore.logLevelStore.getAllLevels().forEach(function addMethod({ name, level }) {\n\t\tObject.defineProperty(logger, name, {\n\t\t\twritable: false,\n\t\t\tvalue: (...args: any[]) => {\n\t\t\t\tif (shouldLog(store, level, logger.level)) write({ id, level, args, timestamp: new Date() })\n\t\t\t}\n\t\t})\n\t})\n\treturn logger\n}\n\nfunction sanitizeId(id: string) {\n\treturn id.replace(/[`~!#$%^&*()=+[\\]{},|<>?]/g, '-')\n}\n\nfunction writeToReporters(\n\treporters: LogReporter[],\n\tlogEntry: LogEntry,\n\tfilter: (reporterId: string) => boolean\n) {\n\treporters.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\treturn targetLevel <= (loggerLevel !== undefined ? loggerLevel : store.logLevel)\n}\n","import type { LogStore } from './log_store.js'\nimport { record } from './record.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n\tconfigured?: boolean\n\tgsl?: { store: LogStore; standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n","import { required } from 'unpartial'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './log_levels.js'\nimport { createLogStore, type LogStore } from './log_store.js'\nimport { createLogger } from './logger.js'\nimport { record } from './record.js'\nimport { ctx } from './standard_log.ctx.js'\nimport type {\n\tLogger,\n\tLoggerOptions,\n\tLogMethodNames,\n\tStandardLogInstance,\n\tStandardLogOptions\n} from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): StandardLog<N> {\n\tconst closure = createStandardLogClosure(options)\n\tif (options?.reporters?.some(r => !r.id)) {\n\t\tconst log = closure.standardLog.getLogger('standard-log')\n\t\tlog.critical(\n\t\t\t`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\t\t)\n\t}\n\n\tif (!ctx.gsl) ctx.gsl = closure as any\n\treturn closure.standardLog\n}\n\nfunction noop() {}\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): { store: LogStore; standardLog: StandardLog<N> } {\n\t// TODO reporter.id must not be empty\n\tconst store = createLogStore(required({ logLevel: logLevels.info }, options))\n\tconst nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n\tconst logMethods = DEFAULT_LOG_METHOD_NAMES.concat(Object.keys(options?.customLevels ?? {})).concat([\n\t\t'on',\n\t\t'count',\n\t\t'write'\n\t])\n\treturn {\n\t\tstore,\n\t\tstandardLog: {\n\t\t\tget logLevel() {\n\t\t\t\treturn store.logLevel\n\t\t\t},\n\n\t\t\ttoLogLevelName(level: number) {\n\t\t\t\treturn store.logLevelStore.getName(level)\n\t\t\t},\n\t\t\ttoLogLevel(name: string) {\n\t\t\t\treturn store.logLevelStore.getLevel(name)\n\t\t\t},\n\t\t\tgetLogger(id: string, options?: LoggerOptions) {\n\t\t\t\tif (store.loggers[id]) return store.loggers[id] as any\n\t\t\t\treturn (store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any)\n\t\t\t},\n\t\t\tgetNonConsoleLogger(id, options?) {\n\t\t\t\tif (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n\t\t\t\tif (store.loggers[id]) {\n\t\t\t\t\tconst log = this.getLogger('standard-log')\n\t\t\t\t\tlog.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n\t\t\t\t\treturn (store.nonConsoleLoggers[id] = createDummyLogger(logMethods))\n\t\t\t\t}\n\n\t\t\t\treturn (store.nonConsoleLoggers[id] =\n\t\t\t\t\tnonConsoleReporters.length === 0\n\t\t\t\t\t\t? createDummyLogger(logMethods)\n\t\t\t\t\t\t: createLogger(store, id, {\n\t\t\t\t\t\t\t\tssf: this.getNonConsoleLogger,\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\twriteTo(reporterId) {\n\t\t\t\t\t\t\t\t\treturn nonConsoleReporters.indexOf(reporterId) >= 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n\treturn logMethods.reduce((p, m) => {\n\t\tp[m] = noop\n\t\treturn p\n\t}, record()) as Logger\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\tconst origLevels = logs.map(l => l.level)\n\tlogs.forEach(l => (l.level = logLevels.none))\n\tconst result = block()\n\tlogs.forEach((l, i) => (l.level = origLevels[i]))\n\treturn result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (\n\tid: string,\n\toptions?: LoggerOptions\n) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n\treturn getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n\tif (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n\treturn ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n\tif (ctx.configured) {\n\t\tconst log = ctx.gsl!.standardLog.getLogger('standard-log')\n\t\tlog.warn(\n\t\t\t'configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.'\n\t\t)\n\t}\n\n\tif (ctx.gsl) {\n\t\tif (options.logLevel) {\n\t\t\tctx.gsl.store.logLevel = options.logLevel\n\t\t}\n\t\tif (options.reporters) {\n\t\t\tconst reporters = ctx.gsl.store.reporters\n\t\t\treporters.length = 0\n\t\t\treporters.push(...options.reporters)\n\t\t}\n\t} else {\n\t\tctx.gsl = createStandardLogClosure(options)\n\t}\n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cAAc,SAAS;EAerC,QAAO;EAGP,SAAQ;EAGR"}
1
+ {"version":3,"file":"log_store.d.ts","names":[],"sources":["../ts/log_store.ts"],"mappings":";;wBAKgB,eAAe,mBAAmB,gBACjD,SAAS,SAAS,mBAAmB,MACnC;iBAUc;EAChB,SAAS,eAAe;EACxB,mBAAmB,eAAe;EAClC,WAAW;EACX,UAAU;EACV,eAAe,kBAAkB;;iBAGjB;EAChB,eAAe;;wBAGA,cAAc,SAAS;EAcrC,QAAO;EAGP,SAAQ;EAGR"}
package/esm/log_store.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { logLevels, toLogLevel, toLogLevelName } from "./log_levels.js";
2
+ import { record } from "./record.js";
2
3
  import { createConsoleLogReporter } from "./console.js";
3
- import { mapKey, record, reduceByKey } from "type-plus";
4
4
  //#region ts/log_store.ts
5
5
  function createLogStore(options) {
6
6
  return {
@@ -15,7 +15,7 @@ function logLevelStore(options) {
15
15
  const customLevels = options.customLevels || record();
16
16
  const store = {
17
17
  customLevels,
18
- customLevelsReverse: reduceByKey(customLevels, (p, k) => {
18
+ customLevelsReverse: Object.keys(customLevels).reduce((p, k) => {
19
19
  p[customLevels[k]] = k;
20
20
  return p;
21
21
  }, {})
@@ -28,13 +28,13 @@ function logLevelStore(options) {
28
28
  return store.customLevels[name] ?? toLogLevel(name);
29
29
  },
30
30
  getAllLevels() {
31
- return reduceByKey(logLevels, (result, name) => {
31
+ return Object.keys(logLevels).reduce((result, name) => {
32
32
  if (name !== "none" && name !== "all") result.push({
33
33
  name,
34
34
  level: logLevels[name]
35
35
  });
36
36
  return result;
37
- }, mapKey(store.customLevels, (name) => ({
37
+ }, Object.keys(store.customLevels).map((name) => ({
38
38
  name,
39
39
  level: store.customLevels[name]
40
40
  })));
@@ -1 +1 @@
1
- {"version":3,"file":"log_store.js","names":[],"sources":["../ts/log_store.ts"],"sourcesContent":["import { mapKey, record, reduceByKey } from 'type-plus'\nimport { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './log_levels.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(\n\toptions: Required<StandardLogOptions<N>>\n): LogStore {\n\treturn {\n\t\tloggers: record(),\n\t\tnonConsoleLoggers: record(),\n\t\treporters: options.reporters || [createConsoleLogReporter()],\n\t\tlogLevel: options.logLevel,\n\t\tlogLevelStore: logLevelStore(options)\n\t}\n}\n\nexport interface LogStore {\n\tloggers: Record<string, Logger>\n\tnonConsoleLoggers: Record<string, Logger>\n\treporters: LogReporter[]\n\tlogLevel: LogLevel\n\tlogLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n\tcustomLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n\tconst customLevels = options.customLevels || record()\n\n\tconst store = {\n\t\tcustomLevels,\n\t\tcustomLevelsReverse: reduceByKey(\n\t\t\tcustomLevels,\n\t\t\t(p, k) => {\n\t\t\t\tp[customLevels[k]] = k\n\t\t\t\treturn p\n\t\t\t},\n\t\t\t{} as Record<number, string>\n\t\t)\n\t}\n\treturn {\n\t\tgetName(level: number) {\n\t\t\treturn store.customLevelsReverse[level] ?? toLogLevelName(level)\n\t\t},\n\t\tgetLevel(name: string) {\n\t\t\treturn store.customLevels[name] ?? toLogLevel(name)\n\t\t},\n\t\tgetAllLevels() {\n\t\t\treturn reduceByKey(\n\t\t\t\tlogLevels,\n\t\t\t\t(result, name) => {\n\t\t\t\t\tif (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n\t\t\t\t\treturn result\n\t\t\t\t},\n\t\t\t\tmapKey(store.customLevels, name => ({ name, level: store.customLevels[name] }))\n\t\t\t)\n\t\t}\n\t}\n}\n"],"mappings":";;;;AAKA,SAAgB,eACf,SACW;CACX,OAAO;EACN,SAAS,OAAO;EAChB,mBAAmB,OAAO;EAC1B,WAAW,QAAQ,aAAa,CAAC,yBAAyB,CAAC;EAC3D,UAAU,QAAQ;EAClB,eAAe,cAAc,OAAO;CACrC;AACD;AAcA,SAAgB,cAAc,SAA+B;CAC5D,MAAM,eAAe,QAAQ,gBAAgB,OAAO;CAEpD,MAAM,QAAQ;EACb;EACA,qBAAqB,YACpB,eACC,GAAG,MAAM;GACT,EAAE,aAAa,MAAM;GACrB,OAAO;EACR,GACA,CAAC,CACF;CACD;CACA,OAAO;EACN,QAAQ,OAAe;GACtB,OAAO,MAAM,oBAAoB,UAAU,eAAe,KAAK;EAChE;EACA,SAAS,MAAc;GACtB,OAAO,MAAM,aAAa,SAAS,WAAW,IAAI;EACnD;EACA,eAAe;GACd,OAAO,YACN,YACC,QAAQ,SAAS;IACjB,IAAI,SAAS,UAAU,SAAS,OAAO,OAAO,KAAK;KAAE;KAAM,OAAO,UAAU;IAAM,CAAC;IAEnF,OAAO;GACR,GACA,OAAO,MAAM,eAAc,UAAS;IAAE;IAAM,OAAO,MAAM,aAAa;GAAM,EAAE,CAC/E;EACD;CACD;AACD"}
1
+ {"version":3,"file":"log_store.js","names":[],"sources":["../ts/log_store.ts"],"sourcesContent":["import { createConsoleLogReporter } from './console.js'\nimport { logLevels, toLogLevel, toLogLevelName } from './log_levels.js'\nimport { record } from './record.js'\nimport type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'\n\nexport function createLogStore<N extends string = LogMethodNames>(\n\toptions: Required<StandardLogOptions<N>>\n): LogStore {\n\treturn {\n\t\tloggers: record(),\n\t\tnonConsoleLoggers: record(),\n\t\treporters: options.reporters || [createConsoleLogReporter()],\n\t\tlogLevel: options.logLevel,\n\t\tlogLevelStore: logLevelStore(options)\n\t}\n}\n\nexport interface LogStore {\n\tloggers: Record<string, Logger>\n\tnonConsoleLoggers: Record<string, Logger>\n\treporters: LogReporter[]\n\tlogLevel: LogLevel\n\tlogLevelStore: ReturnType<typeof logLevelStore>\n}\n\nexport interface LogLevelStoreOptions {\n\tcustomLevels?: Record<string, number>\n}\n\nexport function logLevelStore(options: LogLevelStoreOptions) {\n\tconst customLevels = options.customLevels || record()\n\n\tconst store = {\n\t\tcustomLevels,\n\t\tcustomLevelsReverse: Object.keys(customLevels).reduce(\n\t\t\t(p, k) => {\n\t\t\t\tp[customLevels[k]] = k\n\t\t\t\treturn p\n\t\t\t},\n\t\t\t{} as Record<number, string>\n\t\t)\n\t}\n\treturn {\n\t\tgetName(level: number) {\n\t\t\treturn store.customLevelsReverse[level] ?? toLogLevelName(level)\n\t\t},\n\t\tgetLevel(name: string) {\n\t\t\treturn store.customLevels[name] ?? toLogLevel(name)\n\t\t},\n\t\tgetAllLevels() {\n\t\t\treturn (Object.keys(logLevels) as Array<keyof typeof logLevels>).reduce(\n\t\t\t\t(result, name) => {\n\t\t\t\t\tif (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })\n\n\t\t\t\t\treturn result\n\t\t\t\t},\n\t\t\t\tObject.keys(store.customLevels).map(name => ({ name, level: store.customLevels[name] }))\n\t\t\t)\n\t\t}\n\t}\n}\n"],"mappings":";;;;AAKA,SAAgB,eACf,SACW;CACX,OAAO;EACN,SAAS,OAAO;EAChB,mBAAmB,OAAO;EAC1B,WAAW,QAAQ,aAAa,CAAC,yBAAyB,CAAC;EAC3D,UAAU,QAAQ;EAClB,eAAe,cAAc,OAAO;CACrC;AACD;AAcA,SAAgB,cAAc,SAA+B;CAC5D,MAAM,eAAe,QAAQ,gBAAgB,OAAO;CAEpD,MAAM,QAAQ;EACb;EACA,qBAAqB,OAAO,KAAK,YAAY,CAAC,CAAC,QAC7C,GAAG,MAAM;GACT,EAAE,aAAa,MAAM;GACrB,OAAO;EACR,GACA,CAAC,CACF;CACD;CACA,OAAO;EACN,QAAQ,OAAe;GACtB,OAAO,MAAM,oBAAoB,UAAU,eAAe,KAAK;EAChE;EACA,SAAS,MAAc;GACtB,OAAO,MAAM,aAAa,SAAS,WAAW,IAAI;EACnD;EACA,eAAe;GACd,OAAQ,OAAO,KAAK,SAAS,CAAC,CAAmC,QAC/D,QAAQ,SAAS;IACjB,IAAI,SAAS,UAAU,SAAS,OAAO,OAAO,KAAK;KAAE;KAAM,OAAO,UAAU;IAAM,CAAC;IAEnF,OAAO;GACR,GACA,OAAO,KAAK,MAAM,YAAY,CAAC,CAAC,KAAI,UAAS;IAAE;IAAM,OAAO,MAAM,aAAa;GAAM,EAAE,CACxF;EACD;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","names":[],"sources":["../ts/memory.ts"],"mappings":";;YAOY,oBAAoB,YAAY;EAC3C,MAAM;;;;;EAKN;EACA;EACA;EACA;EACA;EACA;;YAGW,qBAAqB,aAAa;wBAE9B,mBAAmB,MAAM;wBAazB,wBAAwB,UAAU,mBAAmB,YAAY;wBA+CjE,mCACf,UAAU,mBAAmB,YAC3B"}
1
+ {"version":3,"file":"memory.d.ts","names":[],"sources":["../ts/memory.ts"],"mappings":";;YAMY,oBAAoB,YAAY;EAC3C,MAAM;;;;;EAKN;EACA;EACA;EACA;EACA;EACA;;YAGW,qBAAqB,aAAa;wBAE9B,mBAAmB,MAAM;wBAazB,wBAAwB,UAAU,mBAAmB,YAAY;wBA+CjE,mCACf,UAAU,mBAAmB,YAC3B"}
package/esm/memory.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { formatLogLevel } from "./formatter.js";
2
2
  import { toInspectLogEntry } from "./platform.js";
3
3
  import { createConsoleLogReporter } from "./console.js";
4
- import { unpartial } from "unpartial";
5
- import { required } from "type-plus";
4
+ import { required, unpartial } from "unpartial";
6
5
  //#region ts/memory.ts
7
6
  function toMessageWithLevel(logs) {
8
7
  return logs.map(toInspectLogEntry).map((log) => `${formatLogLevel(log.level)} ${log.args.join(" ")}`).join("\n").replace(/^\(WARN\) already configured for test, ignoring config\(\) call\n/, "");
package/esm/memory.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","names":[],"sources":["../ts/memory.ts"],"sourcesContent":["import { required } from 'type-plus'\nimport { unpartial } from 'unpartial'\nimport { createConsoleLogReporter } from './console.js'\nimport { formatLogLevel } from './formatter.js'\nimport { toInspectLogEntry } from './platform.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n\tlogs: LogEntry[]\n\t/**\n\t * Gets a simple log message for testing.\n\t * The message only contains arguments for each log entry.\n\t */\n\tgetLogMessage(): string\n\tgetLogMessages(): string[]\n\tgetLogMessageWithLevel(): string\n\tgetLogMessagesWithLevel(): string[]\n\tgetLogMessagesWithIdAndLevel(): string[]\n\temit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n\treturn (\n\t\tlogs\n\t\t\t.map(toInspectLogEntry)\n\t\t\t.map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t\t.join('\\n')\n\t\t\t// if it has more than this log,\n\t\t\t// we assume it is running under tests,\n\t\t\t// and remove this log to simplify testing.\n\t\t\t.replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n\t)\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n\treturn Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n\tconst { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n\tconst logs: LogEntry[] = []\n\treturn {\n\t\tid,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tlogs,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tlogs.push(formatter(entry))\n\t\t},\n\t\tgetLogMessage() {\n\t\t\treturn this.getLogMessages().join('\\n')\n\t\t},\n\t\tgetLogMessages() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => log.args.join(' '))\n\t\t},\n\t\tgetLogMessagesWithLevel() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessagesWithIdAndLevel() {\n\t\t\treturn logs\n\t\t\t\t.map(toInspectLogEntry)\n\t\t\t\t.map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessageWithLevel() {\n\t\t\treturn toMessageWithLevel(logs)\n\t\t},\n\t\t/**\n\t\t * emit the saved log to console for easy debugging\n\t\t */\n\t\temit() {\n\t\t\tconst reporter = createConsoleLogReporter()\n\t\t\tlogs.forEach(l => reporter.write(l))\n\t\t}\n\t}\n}\n\nexport function createMemoryWithConsoleLogReporter(\n\toptions?: LogReporterOptions<LogEntry>\n): MemoryLogReporter {\n\treturn Object.freeze(\n\t\tObject.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n\t\t\tisConsoleReporter: true\n\t\t})\n\t)\n}\n"],"mappings":";;;;;;AAuBA,SAAgB,mBAAmB,MAAkB;CACpD,OACC,KACE,IAAI,iBAAiB,CAAC,CACtB,KAAI,QAAO,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG,CAAC,CAChE,KAAK,IAAI,CAAC,CAIV,QAAQ,qEAAqE,EAAE;AAEnF;AAEA,SAAgB,wBAAwB,SAA2D;CAClG,OAAO,OAAO,OAAO,oBAAoB,UAAU,EAAE,IAAI,SAAS,GAAG,OAAO,CAAC,CAAC;AAC/E;AAEA,SAAS,oBAAoB,SAAwC;CACpE,MAAM,EAAE,IAAI,WAAW,WAAW,SAAS;EAAE,IAAI;EAAU,YAAY,MAAgB;CAAE,GAAG,OAAO;CACnG,MAAM,OAAmB,CAAC;CAC1B,OAAO;EACN;EACA,IAAI,YAAY;GACf,OAAO;EACR;EACA,IAAI,SAAS;GACZ,OAAO;EACR;EACA;EACA,MAAM,OAAiB;GACtB,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG;GAC9B,KAAK,KAAK,UAAU,KAAK,CAAC;EAC3B;EACA,gBAAgB;GACf,OAAO,KAAK,eAAe,CAAC,CAAC,KAAK,IAAI;EACvC;EACA,iBAAiB;GAChB,OAAO,KAAK,IAAI,iBAAiB,CAAC,CAAC,KAAI,QAAO,IAAI,KAAK,KAAK,GAAG,CAAC;EACjE;EACA,0BAA0B;GACzB,OAAO,KAAK,IAAI,iBAAiB,CAAC,CAAC,KAAI,QAAO,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG;EACnG;EACA,+BAA+B;GAC9B,OAAO,KACL,IAAI,iBAAiB,CAAC,CACtB,KAAI,QAAO,GAAG,IAAI,GAAG,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG;EAC5E;EACA,yBAAyB;GACxB,OAAO,mBAAmB,IAAI;EAC/B;;;;EAIA,OAAO;GACN,MAAM,WAAW,yBAAyB;GAC1C,KAAK,SAAQ,MAAK,SAAS,MAAM,CAAC,CAAC;EACpC;CACD;AACD;AAEA,SAAgB,mCACf,SACoB;CACpB,OAAO,OAAO,OACb,OAAO,OAAO,oBAAoB,UAAU,EAAE,IAAI,sBAAsB,GAAG,OAAO,CAAC,GAAG,EACrF,mBAAmB,KACpB,CAAC,CACF;AACD"}
1
+ {"version":3,"file":"memory.js","names":[],"sources":["../ts/memory.ts"],"sourcesContent":["import { required, unpartial } from 'unpartial'\nimport { createConsoleLogReporter } from './console.js'\nimport { formatLogLevel } from './formatter.js'\nimport { toInspectLogEntry } from './platform.js'\nimport type { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from './types.js'\n\nexport type MemoryLogReporter = LogReporter<LogEntry> & {\n\tlogs: LogEntry[]\n\t/**\n\t * Gets a simple log message for testing.\n\t * The message only contains arguments for each log entry.\n\t */\n\tgetLogMessage(): string\n\tgetLogMessages(): string[]\n\tgetLogMessageWithLevel(): string\n\tgetLogMessagesWithLevel(): string[]\n\tgetLogMessagesWithIdAndLevel(): string[]\n\temit(): void\n}\n\nexport type MemoryLogFormatter = LogFormatter<LogEntry>\n\nexport function toMessageWithLevel(logs: LogEntry[]) {\n\treturn (\n\t\tlogs\n\t\t\t.map(toInspectLogEntry)\n\t\t\t.map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t\t.join('\\n')\n\t\t\t// if it has more than this log,\n\t\t\t// we assume it is running under tests,\n\t\t\t// and remove this log to simplify testing.\n\t\t\t.replace(/^\\(WARN\\) already configured for test, ignoring config\\(\\) call\\n/, '')\n\t)\n}\n\nexport function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter {\n\treturn Object.freeze(buildMemoryReporter(unpartial({ id: 'memory' }, options)))\n}\n\nfunction buildMemoryReporter(options?: LogReporterOptions<LogEntry>) {\n\tconst { id, formatter, filter } = required({ id: 'memory', formatter: (e: LogEntry) => e }, options)\n\tconst logs: LogEntry[] = []\n\treturn {\n\t\tid,\n\t\tget formatter() {\n\t\t\treturn formatter\n\t\t},\n\t\tget filter() {\n\t\t\treturn filter\n\t\t},\n\t\tlogs,\n\t\twrite(entry: LogEntry) {\n\t\t\tif (filter && !filter(entry)) return\n\t\t\tlogs.push(formatter(entry))\n\t\t},\n\t\tgetLogMessage() {\n\t\t\treturn this.getLogMessages().join('\\n')\n\t\t},\n\t\tgetLogMessages() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => log.args.join(' '))\n\t\t},\n\t\tgetLogMessagesWithLevel() {\n\t\t\treturn logs.map(toInspectLogEntry).map(log => `${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessagesWithIdAndLevel() {\n\t\t\treturn logs\n\t\t\t\t.map(toInspectLogEntry)\n\t\t\t\t.map(log => `${log.id} ${formatLogLevel(log.level)} ${log.args.join(' ')}`)\n\t\t},\n\t\tgetLogMessageWithLevel() {\n\t\t\treturn toMessageWithLevel(logs)\n\t\t},\n\t\t/**\n\t\t * emit the saved log to console for easy debugging\n\t\t */\n\t\temit() {\n\t\t\tconst reporter = createConsoleLogReporter()\n\t\t\tlogs.forEach(l => reporter.write(l))\n\t\t}\n\t}\n}\n\nexport function createMemoryWithConsoleLogReporter(\n\toptions?: LogReporterOptions<LogEntry>\n): MemoryLogReporter {\n\treturn Object.freeze(\n\t\tObject.assign(buildMemoryReporter(unpartial({ id: 'memory-with-console' }, options)), {\n\t\t\tisConsoleReporter: true\n\t\t})\n\t)\n}\n"],"mappings":";;;;;AAsBA,SAAgB,mBAAmB,MAAkB;CACpD,OACC,KACE,IAAI,iBAAiB,CAAC,CACtB,KAAI,QAAO,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG,CAAC,CAChE,KAAK,IAAI,CAAC,CAIV,QAAQ,qEAAqE,EAAE;AAEnF;AAEA,SAAgB,wBAAwB,SAA2D;CAClG,OAAO,OAAO,OAAO,oBAAoB,UAAU,EAAE,IAAI,SAAS,GAAG,OAAO,CAAC,CAAC;AAC/E;AAEA,SAAS,oBAAoB,SAAwC;CACpE,MAAM,EAAE,IAAI,WAAW,WAAW,SAAS;EAAE,IAAI;EAAU,YAAY,MAAgB;CAAE,GAAG,OAAO;CACnG,MAAM,OAAmB,CAAC;CAC1B,OAAO;EACN;EACA,IAAI,YAAY;GACf,OAAO;EACR;EACA,IAAI,SAAS;GACZ,OAAO;EACR;EACA;EACA,MAAM,OAAiB;GACtB,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG;GAC9B,KAAK,KAAK,UAAU,KAAK,CAAC;EAC3B;EACA,gBAAgB;GACf,OAAO,KAAK,eAAe,CAAC,CAAC,KAAK,IAAI;EACvC;EACA,iBAAiB;GAChB,OAAO,KAAK,IAAI,iBAAiB,CAAC,CAAC,KAAI,QAAO,IAAI,KAAK,KAAK,GAAG,CAAC;EACjE;EACA,0BAA0B;GACzB,OAAO,KAAK,IAAI,iBAAiB,CAAC,CAAC,KAAI,QAAO,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG;EACnG;EACA,+BAA+B;GAC9B,OAAO,KACL,IAAI,iBAAiB,CAAC,CACtB,KAAI,QAAO,GAAG,IAAI,GAAG,GAAG,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG;EAC5E;EACA,yBAAyB;GACxB,OAAO,mBAAmB,IAAI;EAC/B;;;;EAIA,OAAO;GACN,MAAM,WAAW,yBAAyB;GAC1C,KAAK,SAAQ,MAAK,SAAS,MAAM,CAAC,CAAC;EACpC;CACD;AACD;AAEA,SAAgB,mCACf,SACoB;CACpB,OAAO,OAAO,OACb,OAAO,OAAO,oBAAoB,UAAU,EAAE,IAAI,sBAAsB,GAAG,OAAO,CAAC,GAAG,EACrF,mBAAmB,KACpB,CAAC,CACF;AACD"}
@@ -1,4 +1,4 @@
1
- import { record } from "type-plus";
1
+ import { record } from "./record.js";
2
2
  //#region ts/platform.browser.ts
3
3
  const toInspectLogEntry = (e) => e;
4
4
  const polyfill = record();
@@ -1 +1 @@
1
- {"version":3,"file":"platform.browser.js","names":[],"sources":["../ts/platform.browser.ts"],"sourcesContent":["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"],"mappings":";;AAGA,MAAa,qBAAqB,MAAgB;AAElD,MAAa,WAAsC,OAAO"}
1
+ {"version":3,"file":"platform.browser.js","names":[],"sources":["../ts/platform.browser.ts"],"sourcesContent":["import { record } from './record.js'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => e\n\nexport const polyfill: { console?: ConsoleLike } = record()\n"],"mappings":";;AAGA,MAAa,qBAAqB,MAAgB;AAElD,MAAa,WAAsC,OAAO"}
package/esm/platform.js CHANGED
@@ -1,5 +1,5 @@
1
+ import { record } from "./record.js";
1
2
  import { inspect } from "node:util";
2
- import { record } from "type-plus";
3
3
  //#region ts/platform.ts
4
4
  const toInspectLogEntry = (e) => (e.args = e.args.map((value) => typeof value === "object" && value !== null ? inspect(value) : value), e);
5
5
  const polyfill = record();
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":[],"sources":["../ts/platform.ts"],"sourcesContent":["import { inspect } from 'node:util'\nimport { record } from 'type-plus'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => (\n\t(e.args = e.args.map(value => (typeof value === 'object' && value !== null ? inspect(value) : value))), e\n)\n\nexport const polyfill: { console?: ConsoleLike } = record()\n"],"mappings":";;;AAIA,MAAa,qBAAqB,OAChC,EAAE,OAAO,EAAE,KAAK,KAAI,UAAU,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,KAAK,IAAI,KAAM,GAAI;AAGzG,MAAa,WAAsC,OAAO"}
1
+ {"version":3,"file":"platform.js","names":[],"sources":["../ts/platform.ts"],"sourcesContent":["import { inspect } from 'node:util'\nimport { record } from './record.js'\nimport type { ConsoleLike, LogEntry } from './types.js'\n\nexport const toInspectLogEntry = (e: LogEntry) => (\n\t(e.args = e.args.map(value => (typeof value === 'object' && value !== null ? inspect(value) : value))), e\n)\n\nexport const polyfill: { console?: ConsoleLike } = record()\n"],"mappings":";;;AAIA,MAAa,qBAAqB,OAChC,EAAE,OAAO,EAAE,KAAK,KAAI,UAAU,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,KAAK,IAAI,KAAM,GAAI;AAGzG,MAAa,WAAsC,OAAO"}
@@ -0,0 +1,9 @@
1
+ //#region ts/record.d.ts
2
+ /**
3
+ * Creates a prototype-less object, optionally seeded with `value`.
4
+ *
5
+ * Inlined from `type-plus` so the CJS build does not `require()` the ESM-only `type-plus`.
6
+ */
7
+ export declare function record<R extends Record<any, any>>(value?: R): R;
8
+ //#endregion
9
+ //# sourceMappingURL=record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.d.ts","names":[],"sources":["../ts/record.ts"],"mappings":";;;;;;wBAKgB,OAAO,UAAU,kBAAkB,QAAQ,IAAI"}
package/esm/record.js ADDED
@@ -0,0 +1,14 @@
1
+ //#region ts/record.ts
2
+ /**
3
+ * Creates a prototype-less object, optionally seeded with `value`.
4
+ *
5
+ * Inlined from `type-plus` so the CJS build does not `require()` the ESM-only `type-plus`.
6
+ */
7
+ function record(value) {
8
+ const r = Object.create(null);
9
+ return value ? Object.assign(r, value) : r;
10
+ }
11
+ //#endregion
12
+ export { record };
13
+
14
+ //# sourceMappingURL=record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.js","names":[],"sources":["../ts/record.ts"],"sourcesContent":["/**\n * Creates a prototype-less object, optionally seeded with `value`.\n *\n * Inlined from `type-plus` so the CJS build does not `require()` the ESM-only `type-plus`.\n */\nexport function record<R extends Record<any, any>>(value?: R): R {\n\tconst r = Object.create(null)\n\treturn value ? Object.assign(r, value) : r\n}\n"],"mappings":";;;;;;AAKA,SAAgB,OAAmC,OAAc;CAChE,MAAM,IAAI,OAAO,OAAO,IAAI;CAC5B,OAAO,QAAQ,OAAO,OAAO,GAAG,KAAK,IAAI;AAC1C"}
@@ -1,4 +1,4 @@
1
- import { record } from "type-plus";
1
+ import { record } from "./record.js";
2
2
  //#region ts/standard_log.ctx.ts
3
3
  const ctx = record();
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.ctx.js","names":[],"sources":["../ts/standard_log.ctx.ts"],"sourcesContent":["import { record } from 'type-plus'\nimport type { LogStore } from './log_store.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n\tconfigured?: boolean\n\tgsl?: { store: LogStore; standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n"],"mappings":";;AAIA,MAAa,MAGT,OAAO"}
1
+ {"version":3,"file":"standard_log.ctx.js","names":[],"sources":["../ts/standard_log.ctx.ts"],"sourcesContent":["import type { LogStore } from './log_store.js'\nimport { record } from './record.js'\nimport type { LogMethodNames, StandardLogInstance } from './types.js'\n\nexport const ctx: {\n\tconfigured?: boolean\n\tgsl?: { store: LogStore; standardLog: StandardLogInstance<LogMethodNames> }\n} = record()\n"],"mappings":";;AAIA,MAAa,MAGT,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.d.ts","names":[],"sources":["../ts/standard_log.ts"],"mappings":";;;iBAaiB,YAAY,mBAAmB,wBAAwB,SAAS,oBAAoB;wBAErF,kBAAkB,mBAAmB,gBACpD,UAAU,mBAAmB,KAC3B,YAAY;wBAeC,yBAAyB,mBAAmB,gBAC3D,UAAU,mBAAmB;EACzB,OAAO;EAAU,aAAa,YAAY;;;;;wBA4D/B,aAAa,GAAG,aAAa,GAAG,KAAK,WAAW,MAAM,WAAW;YASrE,UAAU,mBAAmB,mBACxC,YACA,UAAU,kBACN,OAAO,iBAAiB;wBAEb,UAAU,mBAAmB,gBAAgB,YAAY,UAAU,gBAAa,OAAA,IAAA;wBAUhF,aAAa,SAAS,KAAK"}
1
+ {"version":3,"file":"standard_log.d.ts","names":[],"sources":["../ts/standard_log.ts"],"mappings":";;;iBAciB,YAAY,mBAAmB,wBAAwB,SAAS,oBAAoB;wBAErF,kBAAkB,mBAAmB,gBACpD,UAAU,mBAAmB,KAC3B,YAAY;wBAeC,yBAAyB,mBAAmB,gBAC3D,UAAU,mBAAmB;EACzB,OAAO;EAAU,aAAa,YAAY;;;;;wBA4D/B,aAAa,GAAG,aAAa,GAAG,KAAK,WAAW,MAAM,WAAW;YASrE,UAAU,mBAAmB,mBACxC,YACA,UAAU,kBACN,OAAO,iBAAiB;wBAEb,UAAU,mBAAmB,gBAAgB,YAAY,UAAU,gBAAa,OAAA,IAAA;wBAUhF,aAAa,SAAS,KAAK"}
@@ -1,8 +1,9 @@
1
1
  import { DEFAULT_LOG_METHOD_NAMES, logLevels } from "./log_levels.js";
2
+ import { record } from "./record.js";
2
3
  import { createLogStore } from "./log_store.js";
3
4
  import { createLogger } from "./logger.js";
4
5
  import { ctx } from "./standard_log.ctx.js";
5
- import { record, required } from "type-plus";
6
+ import { required } from "unpartial";
6
7
  //#region ts/standard_log.ts
7
8
  function createStandardLog(options) {
8
9
  const closure = createStandardLogClosure(options);
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.js","names":[],"sources":["../ts/standard_log.ts"],"sourcesContent":["import { record, required } from 'type-plus'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './log_levels.js'\nimport { createLogStore, type LogStore } from './log_store.js'\nimport { createLogger } from './logger.js'\nimport { ctx } from './standard_log.ctx.js'\nimport type {\n\tLogger,\n\tLoggerOptions,\n\tLogMethodNames,\n\tStandardLogInstance,\n\tStandardLogOptions\n} from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): StandardLog<N> {\n\tconst closure = createStandardLogClosure(options)\n\tif (options?.reporters?.some(r => !r.id)) {\n\t\tconst log = closure.standardLog.getLogger('standard-log')\n\t\tlog.critical(\n\t\t\t`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\t\t)\n\t}\n\n\tif (!ctx.gsl) ctx.gsl = closure as any\n\treturn closure.standardLog\n}\n\nfunction noop() {}\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): { store: LogStore; standardLog: StandardLog<N> } {\n\t// TODO reporter.id must not be empty\n\tconst store = createLogStore(required({ logLevel: logLevels.info }, options))\n\tconst nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n\tconst logMethods = DEFAULT_LOG_METHOD_NAMES.concat(Object.keys(options?.customLevels ?? {})).concat([\n\t\t'on',\n\t\t'count',\n\t\t'write'\n\t])\n\treturn {\n\t\tstore,\n\t\tstandardLog: {\n\t\t\tget logLevel() {\n\t\t\t\treturn store.logLevel\n\t\t\t},\n\n\t\t\ttoLogLevelName(level: number) {\n\t\t\t\treturn store.logLevelStore.getName(level)\n\t\t\t},\n\t\t\ttoLogLevel(name: string) {\n\t\t\t\treturn store.logLevelStore.getLevel(name)\n\t\t\t},\n\t\t\tgetLogger(id: string, options?: LoggerOptions) {\n\t\t\t\tif (store.loggers[id]) return store.loggers[id] as any\n\t\t\t\treturn (store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any)\n\t\t\t},\n\t\t\tgetNonConsoleLogger(id, options?) {\n\t\t\t\tif (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n\t\t\t\tif (store.loggers[id]) {\n\t\t\t\t\tconst log = this.getLogger('standard-log')\n\t\t\t\t\tlog.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n\t\t\t\t\treturn (store.nonConsoleLoggers[id] = createDummyLogger(logMethods))\n\t\t\t\t}\n\n\t\t\t\treturn (store.nonConsoleLoggers[id] =\n\t\t\t\t\tnonConsoleReporters.length === 0\n\t\t\t\t\t\t? createDummyLogger(logMethods)\n\t\t\t\t\t\t: createLogger(store, id, {\n\t\t\t\t\t\t\t\tssf: this.getNonConsoleLogger,\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\twriteTo(reporterId) {\n\t\t\t\t\t\t\t\t\treturn nonConsoleReporters.indexOf(reporterId) >= 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n\treturn logMethods.reduce((p, m) => {\n\t\tp[m] = noop\n\t\treturn p\n\t}, record()) as Logger\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\tconst origLevels = logs.map(l => l.level)\n\tlogs.forEach(l => (l.level = logLevels.none))\n\tconst result = block()\n\tlogs.forEach((l, i) => (l.level = origLevels[i]))\n\treturn result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (\n\tid: string,\n\toptions?: LoggerOptions\n) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n\treturn getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n\tif (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n\treturn ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n\tif (ctx.configured) {\n\t\tconst log = ctx.gsl!.standardLog.getLogger('standard-log')\n\t\tlog.warn(\n\t\t\t'configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.'\n\t\t)\n\t}\n\n\tif (ctx.gsl) {\n\t\tif (options.logLevel) {\n\t\t\tctx.gsl.store.logLevel = options.logLevel\n\t\t}\n\t\tif (options.reporters) {\n\t\t\tconst reporters = ctx.gsl.store.reporters\n\t\t\treporters.length = 0\n\t\t\treporters.push(...options.reporters)\n\t\t}\n\t} else {\n\t\tctx.gsl = createStandardLogClosure(options)\n\t}\n\tctx.configured = true\n}\n"],"mappings":";;;;;;AAeA,SAAgB,kBACf,SACiB;CACjB,MAAM,UAAU,yBAAyB,OAAO;CAChD,IAAI,SAAS,WAAW,MAAK,MAAK,CAAC,EAAE,EAAE,GAEtC,QADoB,YAAY,UAAU,cACxC,CAAC,CAAC,SACH,+JACD;CAGD,IAAI,CAAC,IAAI,KAAK,IAAI,MAAM;CACxB,OAAO,QAAQ;AAChB;AAEA,SAAS,OAAO,CAAC;AAEjB,SAAgB,yBACf,SACmD;CAEnD,MAAM,QAAQ,eAAe,SAAS,EAAE,UAAU,UAAU,KAAK,GAAG,OAAO,CAAC;CAC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KAAI,MAAK,EAAE,KAAK;CACxC,KAAK,SAAQ,MAAM,EAAE,QAAQ,UAAU,IAAK;CAC5C,MAAM,SAAS,MAAM;CACrB,KAAK,SAAS,GAAG,MAAO,EAAE,QAAQ,WAAW,EAAG;CAChD,OAAO;AACR;AAOA,SAAgB,UAA6C,IAAY,SAAyB;CACjG,OAAO,YAAe,CAAC,CAAC,UAAU,IAAI,OAAO;AAC9C;AAEA,SAAS,cAAyE;CACjF,IAAI,CAAC,IAAI,KAAK,IAAI,MAAM,yBAAyB;CAEjD,OAAO,IAAI,IAAK;AACjB;AAEA,SAAgB,aAAa,SAAmD;CAC/E,IAAI,IAAI,YAEP,IADgB,IAAK,YAAY,UAAU,cACzC,CAAC,CAAC,KACH,kJACD;CAGD,IAAI,IAAI,KAAK;EACZ,IAAI,QAAQ,UACX,IAAI,IAAI,MAAM,WAAW,QAAQ;EAElC,IAAI,QAAQ,WAAW;GACtB,MAAM,YAAY,IAAI,IAAI,MAAM;GAChC,UAAU,SAAS;GACnB,UAAU,KAAK,GAAG,QAAQ,SAAS;EACpC;CACD,OACC,IAAI,MAAM,yBAAyB,OAAO;CAE3C,IAAI,aAAa;AAClB"}
1
+ {"version":3,"file":"standard_log.js","names":[],"sources":["../ts/standard_log.ts"],"sourcesContent":["import { required } from 'unpartial'\nimport { DEFAULT_LOG_METHOD_NAMES, logLevels } from './log_levels.js'\nimport { createLogStore, type LogStore } from './log_store.js'\nimport { createLogger } from './logger.js'\nimport { record } from './record.js'\nimport { ctx } from './standard_log.ctx.js'\nimport type {\n\tLogger,\n\tLoggerOptions,\n\tLogMethodNames,\n\tStandardLogInstance,\n\tStandardLogOptions\n} from './types.js'\n\nexport interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}\n\nexport function createStandardLog<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): StandardLog<N> {\n\tconst closure = createStandardLogClosure(options)\n\tif (options?.reporters?.some(r => !r.id)) {\n\t\tconst log = closure.standardLog.getLogger('standard-log')\n\t\tlog.critical(\n\t\t\t`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\t\t)\n\t}\n\n\tif (!ctx.gsl) ctx.gsl = closure as any\n\treturn closure.standardLog\n}\n\nfunction noop() {}\n\nexport function createStandardLogClosure<N extends string = LogMethodNames>(\n\toptions?: StandardLogOptions<N>\n): { store: LogStore; standardLog: StandardLog<N> } {\n\t// TODO reporter.id must not be empty\n\tconst store = createLogStore(required({ logLevel: logLevels.info }, options))\n\tconst nonConsoleReporters = options?.reporters?.filter(r => !r.isConsoleReporter).map(r => r.id) ?? []\n\tconst logMethods = DEFAULT_LOG_METHOD_NAMES.concat(Object.keys(options?.customLevels ?? {})).concat([\n\t\t'on',\n\t\t'count',\n\t\t'write'\n\t])\n\treturn {\n\t\tstore,\n\t\tstandardLog: {\n\t\t\tget logLevel() {\n\t\t\t\treturn store.logLevel\n\t\t\t},\n\n\t\t\ttoLogLevelName(level: number) {\n\t\t\t\treturn store.logLevelStore.getName(level)\n\t\t\t},\n\t\t\ttoLogLevel(name: string) {\n\t\t\t\treturn store.logLevelStore.getLevel(name)\n\t\t\t},\n\t\t\tgetLogger(id: string, options?: LoggerOptions) {\n\t\t\t\tif (store.loggers[id]) return store.loggers[id] as any\n\t\t\t\treturn (store.loggers[id] = createLogger(store, id, { ssf: this.getLogger, ...options }) as any)\n\t\t\t},\n\t\t\tgetNonConsoleLogger(id, options?) {\n\t\t\t\tif (store.nonConsoleLoggers[id]) return store.nonConsoleLoggers[id] as any\n\n\t\t\t\tif (store.loggers[id]) {\n\t\t\t\t\tconst log = this.getLogger('standard-log')\n\t\t\t\t\tlog.warn(`attempt to create a non-console logger with existing id ('${id}'), ignoring`)\n\t\t\t\t\treturn (store.nonConsoleLoggers[id] = createDummyLogger(logMethods))\n\t\t\t\t}\n\n\t\t\t\treturn (store.nonConsoleLoggers[id] =\n\t\t\t\t\tnonConsoleReporters.length === 0\n\t\t\t\t\t\t? createDummyLogger(logMethods)\n\t\t\t\t\t\t: createLogger(store, id, {\n\t\t\t\t\t\t\t\tssf: this.getNonConsoleLogger,\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\twriteTo(reporterId) {\n\t\t\t\t\t\t\t\t\treturn nonConsoleReporters.indexOf(reporterId) >= 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction createDummyLogger(logMethods: string[]) {\n\treturn logMethods.reduce((p, m) => {\n\t\tp[m] = noop\n\t\treturn p\n\t}, record()) as Logger\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\tconst origLevels = logs.map(l => l.level)\n\tlogs.forEach(l => (l.level = logLevels.none))\n\tconst result = block()\n\tlogs.forEach((l, i) => (l.level = origLevels[i]))\n\treturn result\n}\n\nexport type GetLogger<N extends string = LogMethodNames> = (\n\tid: string,\n\toptions?: LoggerOptions\n) => Logger<LogMethodNames | N>\n\nexport function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions) {\n\treturn getGlobalSL<N>().getLogger(id, options)\n}\n\nfunction getGlobalSL<N extends string = LogMethodNames>(): StandardLogInstance<N> {\n\tif (!ctx.gsl) ctx.gsl = createStandardLogClosure()\n\n\treturn ctx.gsl!.standardLog as StandardLogInstance<N>\n}\n\nexport function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>) {\n\tif (ctx.configured) {\n\t\tconst log = ctx.gsl!.standardLog.getLogger('standard-log')\n\t\tlog.warn(\n\t\t\t'configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.'\n\t\t)\n\t}\n\n\tif (ctx.gsl) {\n\t\tif (options.logLevel) {\n\t\t\tctx.gsl.store.logLevel = options.logLevel\n\t\t}\n\t\tif (options.reporters) {\n\t\t\tconst reporters = ctx.gsl.store.reporters\n\t\t\treporters.length = 0\n\t\t\treporters.push(...options.reporters)\n\t\t}\n\t} else {\n\t\tctx.gsl = createStandardLogClosure(options)\n\t}\n\tctx.configured = true\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,kBACf,SACiB;CACjB,MAAM,UAAU,yBAAyB,OAAO;CAChD,IAAI,SAAS,WAAW,MAAK,MAAK,CAAC,EAAE,EAAE,GAEtC,QADoB,YAAY,UAAU,cACxC,CAAC,CAAC,SACH,+JACD;CAGD,IAAI,CAAC,IAAI,KAAK,IAAI,MAAM;CACxB,OAAO,QAAQ;AAChB;AAEA,SAAS,OAAO,CAAC;AAEjB,SAAgB,yBACf,SACmD;CAEnD,MAAM,QAAQ,eAAe,SAAS,EAAE,UAAU,UAAU,KAAK,GAAG,OAAO,CAAC;CAC5E,MAAM,sBAAsB,SAAS,WAAW,QAAO,MAAK,CAAC,EAAE,iBAAiB,CAAC,CAAC,KAAI,MAAK,EAAE,EAAE,KAAK,CAAC;CACrG,MAAM,aAAa,yBAAyB,OAAO,OAAO,KAAK,SAAS,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;EACnG;EACA;EACA;CACD,CAAC;CACD,OAAO;EACN;EACA,aAAa;GACZ,IAAI,WAAW;IACd,OAAO,MAAM;GACd;GAEA,eAAe,OAAe;IAC7B,OAAO,MAAM,cAAc,QAAQ,KAAK;GACzC;GACA,WAAW,MAAc;IACxB,OAAO,MAAM,cAAc,SAAS,IAAI;GACzC;GACA,UAAU,IAAY,SAAyB;IAC9C,IAAI,MAAM,QAAQ,KAAK,OAAO,MAAM,QAAQ;IAC5C,OAAQ,MAAM,QAAQ,MAAM,aAAa,OAAO,IAAI;KAAE,KAAK,KAAK;KAAW,GAAG;IAAQ,CAAC;GACxF;GACA,oBAAoB,IAAI,SAAU;IACjC,IAAI,MAAM,kBAAkB,KAAK,OAAO,MAAM,kBAAkB;IAEhE,IAAI,MAAM,QAAQ,KAAK;KAEtB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AAI,aAAa;AAClB"}
package/esm/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { StackTraceMeta } from "@just-func/types";
2
1
  //#region ts/types.d.ts
3
2
  export type StandardLogOptions<CustomLevelNames extends string = LogMethodNames> = {
4
3
  /**
@@ -19,7 +18,11 @@ export type StandardLogOptions<CustomLevelNames extends string = LogMethodNames>
19
18
  logLevel?: number;
20
19
  reporters?: LogReporter[];
21
20
  };
22
- export interface LoggerOptions extends StackTraceMeta {
21
+ export interface LoggerOptions {
22
+ /**
23
+ * Stack start function: the stack trace is adjusted to start from this function.
24
+ */
25
+ ssf?: (...args: any[]) => any;
23
26
  level?: number;
24
27
  writeTo?: LogReporter | ReporterFilter;
25
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../ts/types.ts"],"mappings":";;YAEY,mBAAmB,kCAAkC;;;;;;;;;;;;;;;EAehE,eAAe,OAAO;EACtB;EACA,YAAY;;iBAGI,sBAAsB;EACtC;EACA,UAAU,cAAc;;YAGb,OAAO,mBAAmB;WAC5B;;;;EAIT;;;;;EAKA,SAAS;EACT,GAAG,gBAAgB,GAAG,aAAa;;;;EAInC,MAAM,OAAO;OACP,KAAK,IAAI;;;;YAKJ;YAYA;EACX;EACA;EAEA;EACA,WAAW;;YAGA,gBAAgB;YAEhB,eAAe,KAAK,WAAW;YAE/B,0BAA0B,WAAW;iBAEhC,oBAAoB,mBAAmB;;;;EAIvD;;;;EAIA,eAAe;;;;EAIf,WAAW,MAAM;;;;;;;;;;EAUjB,UAAU,YAAY,UAAU,gBAAgB,OAAO,IAAI;;;;;;;;;;;;EAY3D,oBAAoB,YAAY,UAAU,gBAAgB,OAAO,IAAI;;;;;;;YAQ1D,aAAa,cAAc,OAAO,aAAa;;;;YAK/C,aAAa,OAAO;YAEpB;EAAkB;EAAc;;iBAE3B,YAAY;WACnB;;;;;WAKA,WAAW,aAAa;;;;WAIxB,SAAS;;;;;WAKT;EACT,MAAM,OAAO;;YAGF,mBAAmB;EAC9B;;;;;EAKA,YAAY,aAAa;;;;EAIzB,SAAS;;YAGE;iBAEK;EAChB,SAAS;EACT,QAAQ;EACR,QAAQ;EACR,SAAS"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../ts/types.ts"],"mappings":";YAAY,mBAAmB,kCAAkC;;;;;;;;;;;;;;;EAehE,eAAe,OAAO;EACtB;EACA,YAAY;;iBAGI;;;;EAIhB,UAAU;EACV;EACA,UAAU,cAAc;;YAGb,OAAO,mBAAmB;WAC5B;;;;EAIT;;;;;EAKA,SAAS;EACT,GAAG,gBAAgB,GAAG,aAAa;;;;EAInC,MAAM,OAAO;OACP,KAAK,IAAI;;;;YAKJ;YAYA;EACX;EACA;EAEA;EACA,WAAW;;YAGA,gBAAgB;YAEhB,eAAe,KAAK,WAAW;YAE/B,0BAA0B,WAAW;iBAEhC,oBAAoB,mBAAmB;;;;EAIvD;;;;EAIA,eAAe;;;;EAIf,WAAW,MAAM;;;;;;;;;;EAUjB,UAAU,YAAY,UAAU,gBAAgB,OAAO,IAAI;;;;;;;;;;;;EAY3D,oBAAoB,YAAY,UAAU,gBAAgB,OAAO,IAAI;;;;;;;YAQ1D,aAAa,cAAc,OAAO,aAAa;;;;YAK/C,aAAa,OAAO;YAEpB;EAAkB;EAAc;;iBAE3B,YAAY;WACnB;;;;;WAKA,WAAW,aAAa;;;;WAIxB,SAAS;;;;;WAKT;EACT,MAAM,OAAO;;YAGF,mBAAmB;EAC9B;;;;;EAKA,YAAY,aAAa;;;;EAIzB,SAAS;;YAGE;iBAEK;EAChB,SAAS;EACT,QAAQ;EACR,QAAQ;EACR,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "standard-log",
3
- "version": "13.3.1",
3
+ "version": "13.3.2",
4
4
  "description": "The standard log library",
5
5
  "homepage": "https://github.com/cyberuni/standard-log/tree/main/packages/log",
6
6
  "bugs": {
@@ -58,25 +58,24 @@
58
58
  "!**/test_utils.*"
59
59
  ],
60
60
  "dependencies": {
61
- "@just-func/types": "^0.6.1",
62
61
  "iso-error": "^7.0.0",
63
62
  "ms": "^2.1.3",
64
- "type-plus": "8.0.0-beta.12",
65
63
  "unpartial": "^1.0.8"
66
64
  },
67
65
  "devDependencies": {
68
- "@repobuddy/vitest": "^2.3.0",
66
+ "@repobuddy/vitest": "^3.0.0",
69
67
  "@types/ms": "^2.0.0",
70
68
  "@types/node": "^24.0.0",
71
69
  "@types/ramda": "^0.32.0",
72
- "assertron": "^11.6.0",
70
+ "assertron": "^11.7.2",
73
71
  "depcheck": "^1.4.3",
74
72
  "dirname-filename-esm": "^1.1.1",
75
73
  "ramda": "^0.32.0",
76
74
  "rimraf": "^6.0.0",
77
75
  "tsdown": "^0.23.0",
76
+ "type-plus": "8.0.0",
78
77
  "typescript": "^7.0.2",
79
- "vitest": "^4.1.0"
78
+ "vitest": "^5.0.0"
80
79
  },
81
80
  "scripts": {
82
81
  "build": "tsdown",
package/ts/log_store.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { mapKey, record, reduceByKey } from 'type-plus'
2
1
  import { createConsoleLogReporter } from './console.js'
3
2
  import { logLevels, toLogLevel, toLogLevelName } from './log_levels.js'
3
+ import { record } from './record.js'
4
4
  import type { Logger, LogLevel, LogMethodNames, LogReporter, StandardLogOptions } from './types.js'
5
5
 
6
6
  export function createLogStore<N extends string = LogMethodNames>(
@@ -32,8 +32,7 @@ export function logLevelStore(options: LogLevelStoreOptions) {
32
32
 
33
33
  const store = {
34
34
  customLevels,
35
- customLevelsReverse: reduceByKey(
36
- customLevels,
35
+ customLevelsReverse: Object.keys(customLevels).reduce(
37
36
  (p, k) => {
38
37
  p[customLevels[k]] = k
39
38
  return p
@@ -49,14 +48,13 @@ export function logLevelStore(options: LogLevelStoreOptions) {
49
48
  return store.customLevels[name] ?? toLogLevel(name)
50
49
  },
51
50
  getAllLevels() {
52
- return reduceByKey(
53
- logLevels,
51
+ return (Object.keys(logLevels) as Array<keyof typeof logLevels>).reduce(
54
52
  (result, name) => {
55
53
  if (name !== 'none' && name !== 'all') result.push({ name, level: logLevels[name] })
56
54
 
57
55
  return result
58
56
  },
59
- mapKey(store.customLevels, name => ({ name, level: store.customLevels[name] }))
57
+ Object.keys(store.customLevels).map(name => ({ name, level: store.customLevels[name] }))
60
58
  )
61
59
  }
62
60
  }