standard-log 13.3.0 → 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 (102) hide show
  1. package/cjs/console.d.ts +5 -6
  2. package/cjs/console.d.ts.map +1 -1
  3. package/cjs/console.js +2 -2
  4. package/cjs/console.js.map +1 -1
  5. package/cjs/errors.d.ts +2 -3
  6. package/cjs/errors.d.ts.map +1 -1
  7. package/cjs/formatter.d.ts +5 -6
  8. package/cjs/formatter.d.ts.map +1 -1
  9. package/cjs/log_levels.d.ts +4 -5
  10. package/cjs/log_levels.d.ts.map +1 -1
  11. package/cjs/log_store.d.ts +4 -5
  12. package/cjs/log_store.d.ts.map +1 -1
  13. package/cjs/log_store.js +7 -7
  14. package/cjs/log_store.js.map +1 -1
  15. package/cjs/logger.d.ts +1 -2
  16. package/cjs/logger.d.ts.map +1 -1
  17. package/cjs/memory.d.ts +5 -6
  18. package/cjs/memory.d.ts.map +1 -1
  19. package/cjs/memory.js +4 -4
  20. package/cjs/memory.js.map +1 -1
  21. package/cjs/platform.browser.d.ts +2 -3
  22. package/cjs/platform.browser.d.ts.map +1 -1
  23. package/cjs/platform.browser.js +2 -2
  24. package/cjs/platform.browser.js.map +1 -1
  25. package/cjs/platform.d.ts +2 -3
  26. package/cjs/platform.d.ts.map +1 -1
  27. package/cjs/platform.js +2 -2
  28. package/cjs/platform.js.map +1 -1
  29. package/cjs/record.d.ts +9 -0
  30. package/cjs/record.d.ts.map +1 -0
  31. package/cjs/record.js +15 -0
  32. package/cjs/record.js.map +1 -0
  33. package/cjs/standard_log.ctx.d.ts +1 -2
  34. package/cjs/standard_log.ctx.d.ts.map +1 -1
  35. package/cjs/standard_log.ctx.js +1 -1
  36. package/cjs/standard_log.ctx.js.map +1 -1
  37. package/cjs/standard_log.d.ts +7 -8
  38. package/cjs/standard_log.d.ts.map +1 -1
  39. package/cjs/standard_log.js +4 -3
  40. package/cjs/standard_log.js.map +1 -1
  41. package/cjs/standard_log.testing.d.ts +3 -4
  42. package/cjs/standard_log.testing.d.ts.map +1 -1
  43. package/cjs/types.d.ts +20 -18
  44. package/cjs/types.d.ts.map +1 -1
  45. package/dist/standard-log.esm.js +15 -31
  46. package/dist/standard-log.esm.js.map +1 -1
  47. package/dist/standard-log.iife.js +15 -31
  48. package/dist/standard-log.iife.js.map +1 -1
  49. package/esm/console.d.ts +5 -6
  50. package/esm/console.d.ts.map +1 -1
  51. package/esm/console.js +1 -1
  52. package/esm/console.js.map +1 -1
  53. package/esm/errors.d.ts +2 -3
  54. package/esm/errors.d.ts.map +1 -1
  55. package/esm/formatter.d.ts +5 -6
  56. package/esm/formatter.d.ts.map +1 -1
  57. package/esm/log_levels.d.ts +4 -5
  58. package/esm/log_levels.d.ts.map +1 -1
  59. package/esm/log_store.d.ts +4 -5
  60. package/esm/log_store.d.ts.map +1 -1
  61. package/esm/log_store.js +4 -4
  62. package/esm/log_store.js.map +1 -1
  63. package/esm/logger.d.ts +1 -2
  64. package/esm/logger.d.ts.map +1 -1
  65. package/esm/memory.d.ts +5 -6
  66. package/esm/memory.d.ts.map +1 -1
  67. package/esm/memory.js +1 -1
  68. package/esm/memory.js.map +1 -1
  69. package/esm/platform.browser.d.ts +2 -3
  70. package/esm/platform.browser.d.ts.map +1 -1
  71. package/esm/platform.browser.js +1 -1
  72. package/esm/platform.browser.js.map +1 -1
  73. package/esm/platform.d.ts +2 -3
  74. package/esm/platform.d.ts.map +1 -1
  75. package/esm/platform.js +1 -1
  76. package/esm/platform.js.map +1 -1
  77. package/esm/record.d.ts +9 -0
  78. package/esm/record.d.ts.map +1 -0
  79. package/esm/record.js +14 -0
  80. package/esm/record.js.map +1 -0
  81. package/esm/standard_log.ctx.d.ts +1 -2
  82. package/esm/standard_log.ctx.d.ts.map +1 -1
  83. package/esm/standard_log.ctx.js +1 -1
  84. package/esm/standard_log.ctx.js.map +1 -1
  85. package/esm/standard_log.d.ts +7 -8
  86. package/esm/standard_log.d.ts.map +1 -1
  87. package/esm/standard_log.js +2 -1
  88. package/esm/standard_log.js.map +1 -1
  89. package/esm/standard_log.testing.d.ts +3 -4
  90. package/esm/standard_log.testing.d.ts.map +1 -1
  91. package/esm/types.d.ts +20 -18
  92. package/esm/types.d.ts.map +1 -1
  93. package/package.json +7 -7
  94. package/ts/console.ts +1 -1
  95. package/ts/log_store.ts +4 -6
  96. package/ts/memory.ts +1 -1
  97. package/ts/platform.browser.ts +1 -1
  98. package/ts/platform.ts +1 -1
  99. package/ts/record.ts +9 -0
  100. package/ts/standard_log.ctx.ts +1 -1
  101. package/ts/standard_log.ts +2 -1
  102. package/ts/types.ts +5 -3
package/cjs/console.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import { ConsoleLike, LogFormatter, LogReporter, LogReporterOptions } from "./types.js";
2
2
  //#region ts/console.d.ts
3
- declare function toConsoleMethod(level: number): "debug" | "error" | "info" | "warn";
4
- type ConsoleLogFormatter = LogFormatter<any[]>;
5
- type ConsoleLogReporter = LogReporter<any[]> & {
3
+ export declare function toConsoleMethod(level: number): "debug" | "error" | "info" | "warn";
4
+ export type ConsoleLogFormatter = LogFormatter<any[]>;
5
+ export type ConsoleLogReporter = LogReporter<any[]> & {
6
6
  console: ConsoleLike;
7
7
  };
8
- type ConsoleLogReporterOptions = LogReporterOptions<any[]>;
9
- declare function createConsoleLogReporter(options?: ConsoleLogReporterOptions): ConsoleLogReporter;
8
+ export type ConsoleLogReporterOptions = LogReporterOptions<any[]>;
9
+ export declare function createConsoleLogReporter(options?: ConsoleLogReporterOptions): ConsoleLogReporter;
10
10
  //#endregion
11
- export { ConsoleLogFormatter, ConsoleLogReporter, ConsoleLogReporterOptions, createConsoleLogReporter, toConsoleMethod };
12
11
  //# sourceMappingURL=console.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","names":[],"sources":["../ts/console.ts"],"mappings":";;iBAMgB,gBAAgB;KA8CpB,sBAAsB;KACtB,qBAAqB;EAAuB,SAAS;;KACrD,4BAA4B;iBAExB,yBAAyB,UAAU,4BAA4B"}
1
+ {"version":3,"file":"console.d.ts","names":[],"sources":["../ts/console.ts"],"mappings":";;wBAMgB,gBAAgB;YA8CpB,sBAAsB;YACtB,qBAAqB;EAAuB,SAAS;;YACrD,4BAA4B;wBAExB,yBAAyB,UAAU,4BAA4B"}
package/cjs/console.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_log_levels = require("./log_levels.js");
3
3
  const require_formatter = require("./formatter.js");
4
4
  const require_platform = require("./platform.js");
5
- let type_plus = require("type-plus");
5
+ let unpartial = require("unpartial");
6
6
  //#region ts/console.ts
7
7
  function toConsoleMethod(level) {
8
8
  switch (true) {
@@ -35,7 +35,7 @@ function buildFn(name) {
35
35
  };
36
36
  }
37
37
  function createConsoleLogReporter(options) {
38
- const { id, formatter, filter } = (0, type_plus.unpartial)({
38
+ const { id, formatter, filter } = (0, unpartial.unpartial)({
39
39
  id: "console",
40
40
  formatter: require_formatter.consoleFormatter
41
41
  }, options);
@@ -1 +1 @@
1
- {"version":3,"file":"console.js","names":["logLevels","unpartial","consoleFormatter","polyfill"],"sources":["../ts/console.ts"],"sourcesContent":["import { unpartial } from 'type-plus'\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"],"mappings":";;;;;;AAMA,SAAgB,gBAAgB,OAAe;CA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AAY;GACf,OAAO;EACR;EACA,IAAI,SAAS;GACZ,OAAO;EACR;EACA,SAASA,iBAAAA,SAAS;EAClB,MAAM,OAAiB;GACtB,IAAI,UAAU,CAAC,OAAO,KAAK,GAAG;GAC9B,MAAM,SAAS,UAAU,KAAK;GAC9B,MAAM,SAAS,gBAAgB,MAAM,KAAK;GAC1C,KAAK,QAAQ,OAAO,CAAC,GAAG,MAAM;EAC/B;CACD,CAAC;AACF"}
1
+ {"version":3,"file":"console.js","names":["logLevels","consoleFormatter","polyfill"],"sources":["../ts/console.ts"],"sourcesContent":["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"],"mappings":";;;;;;AAMA,SAAgB,gBAAgB,OAAe;CAC9C,QAAQ,MAAR;EAEC,KAAK,SAAS,GACb,OAAO;EACR,KAAK,SAASA,mBAAAA,UAAU,OACvB,OAAO;EACR,KAAK,SAASA,mBAAAA,UAAU,MACvB,OAAO;EACR,KAAK,SAASA,mBAAAA,UAAU,MACvB,OAAO;EACR,SACC,OAAO;CACT;AACD;;AAIA,SAAS,uBAAuB;CAG/B,IAAI,CADa,CAAC,QAAQ,IAAI,MAE7B,OAAO;EAGN,QAAQ,OAAO,QAAQ,SAAS,aAAa,QAAQ,QAAQ,QAAQ,IAAA,CAAK,KAAK,OAAO;EACtF,OAAO,OAAO,QAAQ,SAAS,aAAa,Q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class StandardLogError extends ModuleError {
6
+ export declare class StandardLogError extends ModuleError {
7
7
  constructor(description: string, options?: IsoError.Options);
8
8
  }
9
9
  /**
10
10
  * @deprecated no longer used since 11.2.0
11
11
  */
12
- declare class InvalidId extends StandardLogError {
12
+ export declare class InvalidId extends StandardLogError {
13
13
  id: string;
14
14
  constructor(id: string, options?: IsoError.Options);
15
15
  }
16
16
  //#endregion
17
- export { InvalidId, StandardLogError };
18
17
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":";;;;;cAKa,yBAAyB;EACrC,YAAY,qBAAqB,UAAU,SAAS;;;;;cAQxC,kBAAkB;EAEtB;EADR,YACQ,YACP,UAAU,SAAS"}
1
+ {"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":";;;;;qBAKa,yBAAyB;EACrC,YAAY,qBAAqB,UAAU,SAAS;;;;;qBAQxC,kBAAkB;EAEtB;EADR,YACQ,YACP,UAAU,SAAS"}
@@ -1,19 +1,18 @@
1
1
  import { LogEntry } from "./types.js";
2
2
  //#region ts/formatter.d.ts
3
- type TimestampFormat = 'none' | 'iso' | 'elapsed';
4
- declare function createTimestampFormatter(format: TimestampFormat): (timestamp: Date) => string | undefined;
5
- declare function formatLogLevel(level: number): string;
3
+ export type TimestampFormat = 'none' | 'iso' | 'elapsed';
4
+ export declare function createTimestampFormatter(format: TimestampFormat): (timestamp: Date) => string | undefined;
5
+ export declare function formatLogLevel(level: number): string;
6
6
  /**
7
7
  * Formats log entry as plain text with the following format:
8
8
  * `timestamp id level ...args`
9
9
  *
10
10
  * This is typically useful for writing logs to file
11
11
  */
12
- declare function plainLogFormatter({ id, level, args, timestamp }: LogEntry): any[];
12
+ export declare function plainLogFormatter({ id, level, args, timestamp }: LogEntry): any[];
13
13
  /**
14
14
  * Formats log entry like default console log.
15
15
  */
16
- declare function consoleFormatter({ args }: LogEntry): any[];
16
+ export declare function consoleFormatter({ args }: LogEntry): any[];
17
17
  //#endregion
18
- export { TimestampFormat, consoleFormatter, createTimestampFormatter, formatLogLevel, plainLogFormatter };
19
18
  //# sourceMappingURL=formatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.d.ts","names":[],"sources":["../ts/formatter.ts"],"mappings":";;KAIY;iBAEI,yBAAyB,QAAQ,mBAAmB,WAAW;iBAkB/D,eAAe;;;;;;;iBAUf,oBAAoB,IAAI,OAAO,MAAM,aAAa;;;;iBAOlD,mBAAmB,QAAQ"}
1
+ {"version":3,"file":"formatter.d.ts","names":[],"sources":["../ts/formatter.ts"],"mappings":";;YAIY;wBAEI,yBAAyB,QAAQ,mBAAmB,WAAW;wBAkB/D,eAAe;;;;;;;wBAUf,oBAAoB,IAAI,OAAO,MAAM,aAAa;;;;wBAOlD,mBAAmB,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  //#region ts/log_levels.d.ts
2
- declare const logLevels: {
2
+ export declare const logLevels: {
3
3
  /**
4
4
  * none: 0
5
5
  */
@@ -73,12 +73,11 @@ declare const logLevels: {
73
73
  /**
74
74
  * Convert default log level value to log level name.
75
75
  */
76
- declare function toLogLevelName(level: number): "alert" | "critical" | "debug" | "emergency" | "error" | "info" | "notice" | "planck" | "trace" | "warn";
76
+ export declare function toLogLevelName(level: number): "alert" | "critical" | "debug" | "emergency" | "error" | "info" | "notice" | "planck" | "trace" | "warn";
77
77
  /**
78
78
  * Convert default log level name to log level value.
79
79
  */
80
- declare function toLogLevel(name: string): number | undefined;
81
- declare const DEFAULT_LOG_METHOD_NAMES: string[];
80
+ export declare function toLogLevel(name: string): number | undefined;
81
+ export declare const DEFAULT_LOG_METHOD_NAMES: string[];
82
82
  //#endregion
83
- export { DEFAULT_LOG_METHOD_NAMES, logLevels, toLogLevel, toLogLevelName };
84
83
  //# sourceMappingURL=log_levels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log_levels.d.ts","names":[],"sources":["../ts/log_levels.ts"],"mappings":";cAAa;;;;EAIZ;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;;EAOA;;;;EAIA;;;;;iBAMe,eAAe;;;;iBAgBf,WAAW;cAId"}
1
+ {"version":3,"file":"log_levels.d.ts","names":[],"sources":["../ts/log_levels.ts"],"mappings":";qBAAa;;;;EAIZ;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;;EAOA;;;;EAIA;;;;;wBAMe,eAAe;;;;wBAgBf,WAAW;qBAId"}
@@ -1,17 +1,17 @@
1
1
  import { LogLevel, LogMethodNames, LogReporter, Logger, StandardLogOptions } from "./types.js";
2
2
  //#region ts/log_store.d.ts
3
- declare function createLogStore<N extends string = LogMethodNames>(options: Required<StandardLogOptions<N>>): LogStore;
4
- interface LogStore {
3
+ export declare function createLogStore<N extends string = LogMethodNames>(options: Required<StandardLogOptions<N>>): LogStore;
4
+ export interface LogStore {
5
5
  loggers: Record<string, Logger>;
6
6
  nonConsoleLoggers: Record<string, Logger>;
7
7
  reporters: LogReporter[];
8
8
  logLevel: LogLevel;
9
9
  logLevelStore: ReturnType<typeof logLevelStore>;
10
10
  }
11
- interface LogLevelStoreOptions {
11
+ export interface LogLevelStoreOptions {
12
12
  customLevels?: Record<string, number>;
13
13
  }
14
- declare function logLevelStore(options: LogLevelStoreOptions): {
14
+ export declare function logLevelStore(options: LogLevelStoreOptions): {
15
15
  getName(level: number): string;
16
16
  getLevel(name: string): number;
17
17
  getAllLevels(): {
@@ -20,5 +20,4 @@ declare function logLevelStore(options: LogLevelStoreOptions): {
20
20
  }[];
21
21
  };
22
22
  //#endregion
23
- export { LogLevelStoreOptions, LogStore, createLogStore, logLevelStore };
24
23
  //# sourceMappingURL=log_store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log_store.d.ts","names":[],"sources":["../ts/log_store.ts"],"mappings":";;iBAKgB,eAAe,mBAAmB,gBACjD,SAAS,SAAS,mBAAmB,MACnC;UAUc;EAChB,SAAS,eAAe;EACxB,mBAAmB,eAAe;EAClC,WAAW;EACX,UAAU;EACV,eAAe,kBAAkB;;UAGjB;EAChB,eAAe;;iBAGA,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/cjs/log_store.js CHANGED
@@ -1,22 +1,22 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_log_levels = require("./log_levels.js");
3
+ const require_record = require("./record.js");
3
4
  const require_console = require("./console.js");
4
- let type_plus = require("type-plus");
5
5
  //#region ts/log_store.ts
6
6
  function createLogStore(options) {
7
7
  return {
8
- loggers: (0, type_plus.record)(),
9
- nonConsoleLoggers: (0, type_plus.record)(),
8
+ loggers: require_record.record(),
9
+ nonConsoleLoggers: require_record.record(),
10
10
  reporters: options.reporters || [require_console.createConsoleLogReporter()],
11
11
  logLevel: options.logLevel,
12
12
  logLevelStore: logLevelStore(options)
13
13
  };
14
14
  }
15
15
  function logLevelStore(options) {
16
- const customLevels = options.customLevels || (0, type_plus.record)();
16
+ const customLevels = options.customLevels || require_record.record();
17
17
  const store = {
18
18
  customLevels,
19
- customLevelsReverse: (0, type_plus.reduceByKey)(customLevels, (p, k) => {
19
+ customLevelsReverse: Object.keys(customLevels).reduce((p, k) => {
20
20
  p[customLevels[k]] = k;
21
21
  return p;
22
22
  }, {})
@@ -29,13 +29,13 @@ function logLevelStore(options) {
29
29
  return store.customLevels[name] ?? require_log_levels.toLogLevel(name);
30
30
  },
31
31
  getAllLevels() {
32
- return (0, type_plus.reduceKey)(require_log_levels.logLevels, (result, name) => {
32
+ return Object.keys(require_log_levels.logLevels).reduce((result, name) => {
33
33
  if (name !== "none" && name !== "all") result.push({
34
34
  name,
35
35
  level: require_log_levels.logLevels[name]
36
36
  });
37
37
  return result;
38
- }, (0, type_plus.mapKey)(store.customLevels, (name) => ({
38
+ }, Object.keys(store.customLevels).map((name) => ({
39
39
  name,
40
40
  level: store.customLevels[name]
41
41
  })));
@@ -1 +1 @@
1
- {"version":3,"file":"log_store.js","names":["record","createConsoleLogReporter","reduceByKey","toLogLevelName","toLogLevel","reduceKey","logLevels","mapKey"],"sources":["../ts/log_store.ts"],"sourcesContent":["import { mapKey, record, reduceByKey, reduceKey } 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 reduceKey(\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,UAAA,GAASA,UAAAA,OAAAA,CAAO;EAChB,oBAAA,GAAmBA,UAAAA,OAAAA,CAAO;EAC1B,WAAW,QAAQ,aAAa,CAACC,gBAAAA,yBAAyB,CAAC;EAC3D,UAAU,QAAQ;EAClB,eAAe,cAAc,OAAO;CACrC;AACD;AAcA,SAAgB,cAAc,SAA+B;CAC5D,MAAM,eAAe,QAAQ,iBAAA,GAAgBD,UAAAA,OAAAA,CAAO;CAEpD,MAAM,QAAQ;EACb;EACA,sBAAA,GAAqBE,UAAAA,YAAAA,CACpB,eACC,GAAG,MAAM;GACT,EAAE,aAAa,MAAM;GACrB,OAAO;EACR,GACA,CAAC,CACF;CACD;CACA,OAAO;EACN,QAAQ,OAAe;GACtB,OAAO,MAAM,oBAAoB,UAAUC,mBAAAA,eAAe,KAAK;EAChE;EACA,SAAS,MAAc;GACtB,OAAO,MAAM,aAAa,SAASC,mBAAAA,WAAW,IAAI;EACnD;EACA,eAAe;GACd,QAAA,GAAOC,UAAAA,UAAAA,CACNC,mBAAAA,YACC,QAAQ,SAAS;IACjB,IAAI,SAAS,UAAU,SAAS,OAAO,OAAO,KAAK;KAAE;KAAM,OAAOA,mBAAAA,UAAU;IAAM,CAAC;IAEnF,OAAO;GACR,IAAA,GACAC,UAAAA,OAAAA,CAAO,MAAM,eAAc,UAAS;IAAE;IAAM,OAAO,MAAM,aAAa;GAAM,EAAE,CAC/E;EACD;CACD;AACD"}
1
+ {"version":3,"file":"log_store.js","names":["record","createConsoleLogReporter","toLogLevelName","toLogLevel","logLevels"],"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,SAASA,eAAAA,OAAO;EAChB,mBAAmBA,eAAAA,OAAO;EAC1B,WAAW,QAAQ,aAAa,CAACC,gBAAAA,yBAAyB,CAAC;EAC3D,UAAU,QAAQ;EAClB,eAAe,cAAc,OAAO;CACrC;AACD;AAcA,SAAgB,cAAc,SAA+B;CAC5D,MAAM,eAAe,QAAQ,gBAAgBD,eAAAA,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,UAAUE,mBAAAA,eAAe,KAAK;EAChE;EACA,SAAS,MAAc;GACtB,OAAO,MAAM,aAAa,SAASC,mBAAAA,WAAW,IAAI;EACnD;EACA,eAAe;GACd,OAAQ,OAAO,KAAKC,mBAAAA,SAAS,CAAC,CAAmC,QAC/D,QAAQ,SAAS;IACjB,IAAI,SAAS,UAAU,SAAS,OAAO,OAAO,KAAK;KAAE;KAAM,OAAOA,mBAAAA,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"}
package/cjs/logger.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { LogMethodNames, Logger, LoggerOptions } from "./types.js";
2
2
  import { LogStore } from "./log_store.js";
3
3
  //#region ts/logger.d.ts
4
- declare function createLogger<N extends string = LogMethodNames>(store: LogStore, id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
4
+ export declare function createLogger<N extends string = LogMethodNames>(store: LogStore, id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
5
5
  //#endregion
6
- export { createLogger };
7
6
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","names":[],"sources":["../ts/logger.ts"],"mappings":";;;iBAYgB,aAAa,mBAAmB,gBAC/C,OAAO,UACP,YACA,UAAU,gBACR,OAAO,IAAI"}
1
+ {"version":3,"file":"logger.d.ts","names":[],"sources":["../ts/logger.ts"],"mappings":";;;wBAYgB,aAAa,mBAAmB,gBAC/C,OAAO,UACP,YACA,UAAU,gBACR,OAAO,IAAI"}
package/cjs/memory.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LogEntry, LogFormatter, LogReporter, LogReporterOptions } from "./types.js";
2
2
  //#region ts/memory.d.ts
3
- type MemoryLogReporter = LogReporter<LogEntry> & {
3
+ export type MemoryLogReporter = LogReporter<LogEntry> & {
4
4
  logs: LogEntry[];
5
5
  /**
6
6
  * Gets a simple log message for testing.
@@ -13,10 +13,9 @@ type MemoryLogReporter = LogReporter<LogEntry> & {
13
13
  getLogMessagesWithIdAndLevel(): string[];
14
14
  emit(): void;
15
15
  };
16
- type MemoryLogFormatter = LogFormatter<LogEntry>;
17
- declare function toMessageWithLevel(logs: LogEntry[]): string;
18
- declare function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter;
19
- declare function createMemoryWithConsoleLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter;
16
+ export type MemoryLogFormatter = LogFormatter<LogEntry>;
17
+ export declare function toMessageWithLevel(logs: LogEntry[]): string;
18
+ export declare function createMemoryLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter;
19
+ export declare function createMemoryWithConsoleLogReporter(options?: LogReporterOptions<LogEntry>): MemoryLogReporter;
20
20
  //#endregion
21
- export { MemoryLogFormatter, MemoryLogReporter, createMemoryLogReporter, createMemoryWithConsoleLogReporter, toMessageWithLevel };
22
21
  //# sourceMappingURL=memory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","names":[],"sources":["../ts/memory.ts"],"mappings":";;KAMY,oBAAoB,YAAY;EAC3C,MAAM;;;;;EAKN;EACA;EACA;EACA;EACA;EACA;;KAGW,qBAAqB,aAAa;iBAE9B,mBAAmB,MAAM;iBAazB,wBAAwB,UAAU,mBAAmB,YAAY;iBA+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/cjs/memory.js CHANGED
@@ -2,16 +2,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_formatter = require("./formatter.js");
3
3
  const require_platform = require("./platform.js");
4
4
  const require_console = require("./console.js");
5
- let type_plus = require("type-plus");
5
+ let unpartial = require("unpartial");
6
6
  //#region ts/memory.ts
7
7
  function toMessageWithLevel(logs) {
8
8
  return logs.map(require_platform.toInspectLogEntry).map((log) => `${require_formatter.formatLogLevel(log.level)} ${log.args.join(" ")}`).join("\n").replace(/^\(WARN\) already configured for test, ignoring config\(\) call\n/, "");
9
9
  }
10
10
  function createMemoryLogReporter(options) {
11
- return Object.freeze(buildMemoryReporter((0, type_plus.unpartial)({ id: "memory" }, options)));
11
+ return Object.freeze(buildMemoryReporter((0, unpartial.unpartial)({ id: "memory" }, options)));
12
12
  }
13
13
  function buildMemoryReporter(options) {
14
- const { id, formatter, filter } = (0, type_plus.required)({
14
+ const { id, formatter, filter } = (0, unpartial.required)({
15
15
  id: "memory",
16
16
  formatter: (e) => e
17
17
  }, options);
@@ -54,7 +54,7 @@ function buildMemoryReporter(options) {
54
54
  };
55
55
  }
56
56
  function createMemoryWithConsoleLogReporter(options) {
57
- return Object.freeze(Object.assign(buildMemoryReporter((0, type_plus.unpartial)({ id: "memory-with-console" }, options)), { isConsoleReporter: true }));
57
+ return Object.freeze(Object.assign(buildMemoryReporter((0, unpartial.unpartial)({ id: "memory-with-console" }, options)), { isConsoleReporter: true }));
58
58
  }
59
59
  //#endregion
60
60
  exports.createMemoryLogReporter = createMemoryLogReporter;
package/cjs/memory.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","names":["toInspectLogEntry","formatLogLevel","unpartial","required","createConsoleLogReporter"],"sources":["../ts/memory.ts"],"sourcesContent":["import { required, unpartial } from 'type-plus'\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,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;EAC5E;EACA,yBAAyB;GACxB,OAAO,mBAAmB,IAAI;EAC/B;;;;EAIA,OAAO;GACN,MAAM,WAAWG,gBAAAA,yBAAyB;GAC1C,KAAK,SAAQ,MAAK,SAAS,MAAM,CAAC,CAAC;EACpC;CACD;AACD;AAEA,SAAgB,mCACf,SACoB;CACpB,OAAO,OAAO,OACb,OAAO,OAAO,qBAAA,GAAoBF,UAAAA,UAAAA,CAAU,EAAE,IAAI,sBAAsB,GAAG,OAAO,CAAC,GAAG,EACrF,mBAAmB,KACpB,CAAC,CACF;AACD"}
1
+ {"version":3,"file":"memory.js","names":["toInspectLogEntry","formatLogLevel","required","createConsoleLogReporter"],"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,IAAIA,iBAAAA,iBAAiB,CAAC,CACtB,KAAI,QAAO,GAAGC,kBAAAA,eAAe,IAAI,K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,KAAK,SAAQ,MAAK,SAAS,MAAM,CAAC,CAAC;EACpC;CACD;AACD;AAEA,SAAgB,mCACf,SACoB;CACpB,OAAO,OAAO,OACb,OAAO,OAAO,qBAAA,GAAoB,UAAA,UAAA,CAAU,EAAE,IAAI,sBAAsB,GAAG,OAAO,CAAC,GAAG,EACrF,mBAAmB,KACpB,CAAC,CACF;AACD"}
@@ -1,9 +1,8 @@
1
1
  import { ConsoleLike, LogEntry } from "./types.js";
2
2
  //#region ts/platform.browser.d.ts
3
- declare const toInspectLogEntry: (e: LogEntry) => LogEntry;
4
- declare const polyfill: {
3
+ export declare const toInspectLogEntry: (e: LogEntry) => LogEntry;
4
+ export declare const polyfill: {
5
5
  console?: ConsoleLike;
6
6
  };
7
7
  //#endregion
8
- export { polyfill, toInspectLogEntry };
9
8
  //# sourceMappingURL=platform.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.browser.d.ts","names":[],"sources":["../ts/platform.browser.ts"],"mappings":";;cAGa,oBAAiB,GAAO,aAAQ;cAEhC;EAAY,UAAU"}
1
+ {"version":3,"file":"platform.browser.d.ts","names":[],"sources":["../ts/platform.browser.ts"],"mappings":";;qBAGa,oBAAiB,GAAO,aAAQ;qBAEhC;EAAY,UAAU"}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let type_plus = require("type-plus");
2
+ const require_record = require("./record.js");
3
3
  //#region ts/platform.browser.ts
4
4
  const toInspectLogEntry = (e) => e;
5
- const polyfill = (0, type_plus.record)();
5
+ const polyfill = require_record.record();
6
6
  //#endregion
7
7
  exports.polyfill = polyfill;
8
8
  exports.toInspectLogEntry = toInspectLogEntry;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.browser.js","names":["record"],"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,YAAA,GAAsCA,UAAAA,OAAAA,CAAO"}
1
+ {"version":3,"file":"platform.browser.js","names":["record"],"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,WAAsCA,eAAAA,OAAO"}
package/cjs/platform.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { ConsoleLike, LogEntry } from "./types.js";
2
2
  //#region ts/platform.d.ts
3
- declare const toInspectLogEntry: (e: LogEntry) => LogEntry;
4
- declare const polyfill: {
3
+ export declare const toInspectLogEntry: (e: LogEntry) => LogEntry;
4
+ export declare const polyfill: {
5
5
  console?: ConsoleLike;
6
6
  };
7
7
  //#endregion
8
- export { polyfill, toInspectLogEntry };
9
8
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","names":[],"sources":["../ts/platform.ts"],"mappings":";;cAIa,oBAAiB,GAAO,aAAQ;cAIhC;EAAY,UAAU"}
1
+ {"version":3,"file":"platform.d.ts","names":[],"sources":["../ts/platform.ts"],"mappings":";;qBAIa,oBAAiB,GAAO,aAAQ;qBAIhC;EAAY,UAAU"}
package/cjs/platform.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let type_plus = require("type-plus");
2
+ const require_record = require("./record.js");
3
3
  let node_util = require("node:util");
4
4
  //#region ts/platform.ts
5
5
  const toInspectLogEntry = (e) => (e.args = e.args.map((value) => typeof value === "object" && value !== null ? (0, node_util.inspect)(value) : value), e);
6
- const polyfill = (0, type_plus.record)();
6
+ const polyfill = require_record.record();
7
7
  //#endregion
8
8
  exports.polyfill = polyfill;
9
9
  exports.toInspectLogEntry = toInspectLogEntry;
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":["inspect","record"],"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,QAAA,GAAOA,UAAAA,QAAAA,CAAQ,KAAK,IAAI,KAAM,GAAI;AAGzG,MAAa,YAAA,GAAsCC,UAAAA,OAAAA,CAAO"}
1
+ {"version":3,"file":"platform.js","names":["inspect","record"],"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,QAAA,GAAOA,UAAAA,QAAAA,CAAQ,KAAK,IAAI,KAAM,GAAI;AAGzG,MAAa,WAAsCC,eAAAA,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/cjs/record.js ADDED
@@ -0,0 +1,15 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region ts/record.ts
3
+ /**
4
+ * Creates a prototype-less object, optionally seeded with `value`.
5
+ *
6
+ * Inlined from `type-plus` so the CJS build does not `require()` the ESM-only `type-plus`.
7
+ */
8
+ function record(value) {
9
+ const r = Object.create(null);
10
+ return value ? Object.assign(r, value) : r;
11
+ }
12
+ //#endregion
13
+ exports.record = record;
14
+
15
+ //# 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,7 +1,7 @@
1
1
  import { LogMethodNames, StandardLogInstance } from "./types.js";
2
2
  import { LogStore } from "./log_store.js";
3
3
  //#region ts/standard_log.ctx.d.ts
4
- declare const ctx: {
4
+ export declare const ctx: {
5
5
  configured?: boolean;
6
6
  gsl?: {
7
7
  store: LogStore;
@@ -9,5 +9,4 @@ declare const ctx: {
9
9
  };
10
10
  };
11
11
  //#endregion
12
- export { ctx };
13
12
  //# sourceMappingURL=standard_log.ctx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.ctx.d.ts","names":[],"sources":["../ts/standard_log.ctx.ts"],"mappings":";;;cAIa;EACZ;EACA;IAAQ,OAAO;IAAU,aAAa,oBAAoB"}
1
+ {"version":3,"file":"standard_log.ctx.d.ts","names":[],"sources":["../ts/standard_log.ctx.ts"],"mappings":";;;qBAIa;EACZ;EACA;IAAQ,OAAO;IAAU,aAAa,oBAAoB"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region ts/standard_log.ctx.ts
3
- const ctx = (0, require("type-plus").record)();
3
+ const ctx = require("./record.js").record();
4
4
  //#endregion
5
5
  exports.ctx = ctx;
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.ctx.js","names":["record"],"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,OAAA,sBAGTA,CAAAA,CAAAA,OAAAA,CAAO"}
1
+ {"version":3,"file":"standard_log.ctx.js","names":["record"],"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,2BAGTA,CAAAA,CAAAA,OAAO"}
@@ -1,19 +1,18 @@
1
1
  import { LogMethodNames, Logger, LoggerOptions, StandardLogInstance, StandardLogOptions } from "./types.js";
2
2
  import { LogStore } from "./log_store.js";
3
3
  //#region ts/standard_log.d.ts
4
- interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}
5
- declare function createStandardLog<N extends string = LogMethodNames>(options?: StandardLogOptions<N>): StandardLog<N>;
6
- declare function createStandardLogClosure<N extends string = LogMethodNames>(options?: StandardLogOptions<N>): {
4
+ export interface StandardLog<N extends string = LogMethodNames> extends Readonly<StandardLogInstance<N>> {}
5
+ export declare function createStandardLog<N extends string = LogMethodNames>(options?: StandardLogOptions<N>): StandardLog<N>;
6
+ export declare function createStandardLogClosure<N extends string = LogMethodNames>(options?: StandardLogOptions<N>): {
7
7
  store: LogStore;
8
8
  standardLog: StandardLog<N>;
9
9
  };
10
10
  /**
11
11
  * Suppress logging within the code block.
12
12
  */
13
- declare function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R;
14
- type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>;
15
- declare function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
16
- declare function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>): void;
13
+ export declare function suppressLogs<R>(block: () => R, log: Logger, ...logs: Logger[]): R;
14
+ export type GetLogger<N extends string = LogMethodNames> = (id: string, options?: LoggerOptions) => Logger<LogMethodNames | N>;
15
+ export declare function getLogger<N extends string = LogMethodNames>(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>;
16
+ export declare function configGlobal(options: Omit<StandardLogOptions, 'customLevels'>): void;
17
17
  //#endregion
18
- export { GetLogger, StandardLog, configGlobal, createStandardLog, createStandardLogClosure, getLogger, suppressLogs };
19
18
  //# sourceMappingURL=standard_log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.d.ts","names":[],"sources":["../ts/standard_log.ts"],"mappings":";;;UAaiB,YAAY,mBAAmB,wBAAwB,SAAS,oBAAoB;iBAErF,kBAAkB,mBAAmB,gBACpD,UAAU,mBAAmB,KAC3B,YAAY;iBAeC,yBAAyB,mBAAmB,gBAC3D,UAAU,mBAAmB;EACzB,OAAO;EAAU,aAAa,YAAY;;;;;iBA4D/B,aAAa,GAAG,aAAa,GAAG,KAAK,WAAW,MAAM,WAAW;KASrE,UAAU,mBAAmB,mBACxC,YACA,UAAU,kBACN,OAAO,iBAAiB;iBAEb,UAAU,mBAAmB,gBAAgB,YAAY,UAAU,gBAAa,OAAA,IAAA;iBAUhF,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,9 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_log_levels = require("./log_levels.js");
3
+ const require_record = require("./record.js");
3
4
  const require_log_store = require("./log_store.js");
4
5
  const require_logger = require("./logger.js");
5
6
  const require_standard_log_ctx = require("./standard_log.ctx.js");
6
- let type_plus = require("type-plus");
7
+ let unpartial = require("unpartial");
7
8
  //#region ts/standard_log.ts
8
9
  function createStandardLog(options) {
9
10
  const closure = createStandardLogClosure(options);
@@ -13,7 +14,7 @@ function createStandardLog(options) {
13
14
  }
14
15
  function noop() {}
15
16
  function createStandardLogClosure(options) {
16
- const store = require_log_store.createLogStore((0, type_plus.required)({ logLevel: require_log_levels.logLevels.info }, options));
17
+ const store = require_log_store.createLogStore((0, unpartial.required)({ logLevel: require_log_levels.logLevels.info }, options));
17
18
  const nonConsoleReporters = options?.reporters?.filter((r) => !r.isConsoleReporter).map((r) => r.id) ?? [];
18
19
  const logMethods = require_log_levels.DEFAULT_LOG_METHOD_NAMES.concat(Object.keys(options?.customLevels ?? {})).concat([
19
20
  "on",
@@ -60,7 +61,7 @@ function createDummyLogger(logMethods) {
60
61
  return logMethods.reduce((p, m) => {
61
62
  p[m] = noop;
62
63
  return p;
63
- }, (0, type_plus.record)());
64
+ }, require_record.record());
64
65
  }
65
66
  function suppressLogs(block, ...logs) {
66
67
  const origLevels = logs.map((l) => l.level);
@@ -1 +1 @@
1
- {"version":3,"file":"standard_log.js","names":["ctx","createLogStore","required","logLevels","DEFAULT_LOG_METHOD_NAMES","createLogger","record"],"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,CAACA,yBAAAA,IAAI,KAAK,yBAAA,IAAI,MAAM;CACxB,OAAO,QAAQ;AAChB;AAEA,SAAS,OAAO,CAAC;AAEjB,SAAgB,yBACf,SACmD;CAEnD,MAAM,QAAQC,kBAAAA,gBAAAA,GAAeC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ACP,OAAO;CACR,IAAA,GAAGC,UAAAA,OAAAA,CAAO,CAAC;AACZ;AAMA,SAAgB,aAAgB,OAAgB,GAAG,MAAmB;CACrE,MAAM,aAAa,KAAK,KAAI,MAAK,EAAE,KAAK;CACxC,KAAK,SAAQ,MAAM,EAAE,QAAQH,mBAAAA,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,CAACH,yBAAAA,IAAI,KAAK,yBAAA,IAAI,MAAM,yBAAyB;CAEjD,OAAOA,yBAAAA,IAAI,IAAK;AACjB;AAEA,SAAgB,aAAa,SAAmD;CAC/E,IAAIA,yBAAAA,IAAI,YAEP,yBADYA,IAAI,IAAK,YAAY,UAAU,cACzC,CAAC,CAAC,KACH,kJACD;CAGD,IAAIA,yBAAAA,IAAI,KAAK;EACZ,IAAI,QAAQ,UACX,yBAAA,IAAI,IAAI,MAAM,WAAW,QAAQ;EAElC,IAAI,QAAQ,WAAW;GACtB,MAAM,YAAYA,yBAAAA,IAAI,IAAI,MAAM;GAChC,UAAU,SAAS;GACnB,UAAU,KAAK,GAAG,QAAQ,SAAS;EACpC;CACD,OACC,yBAAA,IAAI,MAAM,yBAAyB,OAAO;CAE3C,yBAAA,IAAI,aAAa;AAClB"}
1
+ {"version":3,"file":"standard_log.js","names":["ctx","createLogStore","required","logLevels","DEFAULT_LOG_METHOD_NAMES","createLogger","record"],"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,CAACA,yBAAAA,IAAI,KAAK,yBAAA,IAAI,MAAM;CACxB,OAAO,QAAQ;AAChB;AAEA,SAAS,OAAO,CAAC;AAEjB,SAAgB,yBACf,SACmD;CAEnD,MAAM,QAAQC,kBAAAA,gBAAAA,GAAeC,UAAAA,SAAAA,CAAS,EAAE,UAAUC,mBAAAA,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,aAAaC,mBAAAA,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,MA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