@decaf-ts/logging 0.10.0 → 0.10.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 (100) hide show
  1. package/README.md +298 -171
  2. package/dist/logging.cjs +1 -1
  3. package/dist/logging.cjs.map +1 -1
  4. package/dist/logging.js +1 -1
  5. package/dist/logging.js.map +1 -1
  6. package/lib/LoggedClass.cjs +4 -4
  7. package/lib/LoggedClass.d.ts +4 -4
  8. package/lib/constants.cjs +32 -63
  9. package/lib/constants.d.ts +32 -63
  10. package/lib/constants.js.map +1 -1
  11. package/lib/decorators.cjs +28 -28
  12. package/lib/decorators.d.ts +29 -36
  13. package/lib/decorators.js.map +1 -1
  14. package/lib/environment.cjs +34 -41
  15. package/lib/environment.d.ts +31 -32
  16. package/lib/environment.js.map +1 -1
  17. package/lib/esm/LoggedClass.d.ts +4 -4
  18. package/lib/esm/LoggedClass.js +4 -4
  19. package/lib/esm/constants.d.ts +32 -63
  20. package/lib/esm/constants.js +32 -63
  21. package/lib/esm/constants.js.map +1 -1
  22. package/lib/esm/decorators.d.ts +29 -36
  23. package/lib/esm/decorators.js +28 -28
  24. package/lib/esm/decorators.js.map +1 -1
  25. package/lib/esm/environment.d.ts +31 -32
  26. package/lib/esm/environment.js +34 -41
  27. package/lib/esm/environment.js.map +1 -1
  28. package/lib/esm/filters/LogFilter.d.ts +11 -11
  29. package/lib/esm/filters/LogFilter.js +5 -5
  30. package/lib/esm/filters/PatternFilter.d.ts +15 -15
  31. package/lib/esm/filters/PatternFilter.js +12 -12
  32. package/lib/esm/index.d.ts +2 -2
  33. package/lib/esm/index.js +3 -3
  34. package/lib/esm/logging.d.ts +119 -113
  35. package/lib/esm/logging.js +223 -138
  36. package/lib/esm/logging.js.map +1 -1
  37. package/lib/esm/pino/index.d.ts +6 -0
  38. package/lib/esm/pino/index.js +6 -0
  39. package/lib/esm/pino/index.js.map +1 -1
  40. package/lib/esm/pino/pino.d.ts +13 -5
  41. package/lib/esm/pino/pino.js +70 -124
  42. package/lib/esm/pino/pino.js.map +1 -1
  43. package/lib/esm/text.d.ts +29 -67
  44. package/lib/esm/text.js +29 -67
  45. package/lib/esm/text.js.map +1 -1
  46. package/lib/esm/time.d.ts +45 -43
  47. package/lib/esm/time.js +38 -36
  48. package/lib/esm/time.js.map +1 -1
  49. package/lib/esm/types.d.ts +59 -50
  50. package/lib/esm/utils.d.ts +43 -0
  51. package/lib/esm/utils.js +55 -3
  52. package/lib/esm/utils.js.map +1 -1
  53. package/lib/esm/web.d.ts +2 -2
  54. package/lib/esm/web.js +2 -2
  55. package/lib/esm/winston/index.d.ts +7 -0
  56. package/lib/esm/winston/index.js +7 -1
  57. package/lib/esm/winston/index.js.map +1 -1
  58. package/lib/esm/winston/winston.d.ts +17 -21
  59. package/lib/esm/winston/winston.js +29 -36
  60. package/lib/esm/winston/winston.js.map +1 -1
  61. package/lib/filters/LogFilter.cjs +5 -5
  62. package/lib/filters/LogFilter.d.ts +11 -11
  63. package/lib/filters/PatternFilter.cjs +12 -12
  64. package/lib/filters/PatternFilter.d.ts +15 -15
  65. package/lib/index.cjs +3 -3
  66. package/lib/index.d.ts +2 -2
  67. package/lib/logging.cjs +224 -139
  68. package/lib/logging.d.ts +119 -113
  69. package/lib/logging.js.map +1 -1
  70. package/lib/pino/index.cjs +6 -0
  71. package/lib/pino/index.d.ts +6 -0
  72. package/lib/pino/index.js.map +1 -1
  73. package/lib/pino/pino.cjs +102 -126
  74. package/lib/pino/pino.d.ts +13 -5
  75. package/lib/pino/pino.js.map +1 -1
  76. package/lib/text.cjs +29 -67
  77. package/lib/text.d.ts +29 -67
  78. package/lib/text.js.map +1 -1
  79. package/lib/time.cjs +38 -36
  80. package/lib/time.d.ts +45 -43
  81. package/lib/time.js.map +1 -1
  82. package/lib/types.d.ts +59 -50
  83. package/lib/utils.cjs +55 -3
  84. package/lib/utils.d.ts +43 -0
  85. package/lib/utils.js.map +1 -1
  86. package/lib/web.cjs +2 -2
  87. package/lib/web.d.ts +2 -2
  88. package/lib/winston/index.cjs +22 -0
  89. package/lib/winston/index.d.ts +7 -0
  90. package/lib/winston/index.js.map +1 -1
  91. package/lib/winston/winston.cjs +29 -36
  92. package/lib/winston/winston.d.ts +17 -21
  93. package/lib/winston/winston.js.map +1 -1
  94. package/package.json +9 -10
  95. package/lib/accumulate.types.cjs +0 -27
  96. package/lib/accumulate.types.d.ts +0 -1
  97. package/lib/accumulate.types.js.map +0 -1
  98. package/lib/esm/accumulate.types.d.ts +0 -1
  99. package/lib/esm/accumulate.types.js +0 -25
  100. package/lib/esm/accumulate.types.js.map +0 -1
package/lib/pino/pino.cjs CHANGED
@@ -1,10 +1,40 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
36
  exports.PinoFactory = exports.PinoLogger = void 0;
7
- const pino_1 = __importDefault(require("pino"));
37
+ const pino_1 = __importStar(require("pino"));
8
38
  const logging_1 = require("./../logging.cjs");
9
39
  const constants_1 = require("./../constants.cjs");
10
40
  const LogLevelToPino = {
@@ -25,106 +55,92 @@ const PinoToLogLevel = {
25
55
  debug: constants_1.LogLevel.debug,
26
56
  trace: constants_1.LogLevel.trace,
27
57
  };
28
- const isPinoLogger = (candidate) => {
29
- if (!candidate || typeof candidate !== "object")
30
- return false;
31
- const required = ["info", "error", "warn", "debug", "trace"];
32
- return required.every((method) => typeof candidate[method] === "function");
33
- };
34
58
  const toPinoLevel = (level) => LogLevelToPino[level] ?? "info";
35
59
  const fromPinoLevel = (level) => {
36
60
  if (!level)
37
61
  return undefined;
38
62
  return PinoToLogLevel[level];
39
63
  };
40
- const buildPinoOptions = (context, config, candidate) => {
64
+ const joinContext = (segments, separator) => {
65
+ if (!segments.length)
66
+ return "Logger";
67
+ return segments.join(separator);
68
+ };
69
+ const buildPinoOptions = (context, config, overrides) => {
41
70
  const options = {
42
71
  level: toPinoLevel(config.level),
43
72
  name: context,
44
- ...(candidate || {}),
73
+ ...overrides,
45
74
  };
46
75
  if (!options.level)
47
76
  options.level = toPinoLevel(config.level);
48
77
  if (!options.name)
49
78
  options.name = context;
79
+ options.timestamp = config.timestamp
80
+ ? () => new Date().toISOString()
81
+ : false;
50
82
  return options;
51
83
  };
52
- const mergePinoConfig = (base, overrides) => {
53
- if (!base && !overrides)
54
- return {};
55
- return {
56
- ...(base || {}),
57
- ...(overrides || {}),
58
- options: {
59
- ...(base?.options || {}),
60
- ...(overrides?.options || {}),
61
- },
62
- };
84
+ const isDestinationStream = (candidate) => {
85
+ if (!candidate || typeof candidate !== "object")
86
+ return false;
87
+ return typeof candidate.write === "function";
63
88
  };
64
- const extractPinoConfig = (config) => {
65
- if (!config)
66
- return {};
67
- const raw = config.pino;
68
- if (!raw || typeof raw !== "object")
69
- return {};
70
- return {
71
- instance: raw.instance,
72
- options: raw.options,
73
- destination: raw.destination,
74
- };
89
+ const buildDestination = (transports) => {
90
+ if (!transports || transports.length === 0)
91
+ return undefined;
92
+ const streams = transports.filter(isDestinationStream);
93
+ if (streams.length <= 1)
94
+ return streams[0];
95
+ return (0, pino_1.multistream)(streams.map((stream) => ({ stream })));
75
96
  };
76
- const getPinoConfig = (globalConfig, instanceConfig) => mergePinoConfig(extractPinoConfig(globalConfig), extractPinoConfig(instanceConfig));
97
+ /**
98
+ * @description A logger that is powered by the Pino logging library.
99
+ * @summary This class extends {@link MiniLogger} and uses Pino as its underlying logging engine.
100
+ * @param {string} [context] - The context (typically the class name) that this logger is associated with.
101
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
102
+ * @param {PinoBaseLogger} [driver] - An optional, pre-existing Pino logger instance to use.
103
+ * @class PinoLogger
104
+ */
77
105
  class PinoLogger extends logging_1.MiniLogger {
78
- constructor(context, conf) {
106
+ constructor(context, conf, driver) {
79
107
  super(context, conf);
80
- this.childLoggers = new Map();
108
+ if (driver) {
109
+ this.pino = driver;
110
+ const derivedLevel = fromPinoLevel(driver.level);
111
+ if (derivedLevel)
112
+ this.setConfig({ level: derivedLevel });
113
+ return;
114
+ }
81
115
  const globalConfig = logging_1.Logging.getConfig();
82
116
  const config = Object.assign({}, globalConfig, this.conf || {});
83
- const pinoConfig = getPinoConfig(globalConfig, this.conf);
84
- if (isPinoLogger(pinoConfig.instance)) {
85
- this.pino = pinoConfig.instance;
86
- const logLevel = fromPinoLevel(this.pino.level);
87
- if (logLevel)
88
- this.conf = { ...(this.conf || {}), level: logLevel };
89
- }
90
- else {
91
- const options = buildPinoOptions(context, config, pinoConfig.options);
92
- this.pino = (0, pino_1.default)(options, pinoConfig.destination);
93
- }
94
- }
95
- activePino() {
96
- const override = this.config("pino");
97
- if (override && override.instance && isPinoLogger(override.instance)) {
98
- return override.instance;
99
- }
100
- return this.pino;
117
+ const separator = config.contextSeparator ||
118
+ logging_1.Logging.getConfig().contextSeparator;
119
+ const contextName = joinContext(Array.isArray(this.context) ? this.context : [], separator);
120
+ const options = buildPinoOptions(contextName, config);
121
+ const destination = buildDestination(config.transports || undefined);
122
+ this.pino = (0, pino_1.default)(options, destination);
101
123
  }
102
124
  log(level, msg, error) {
103
- const configuredLevel = this.config("level") || constants_1.LogLevel.info;
104
- if (constants_1.NumericLogLevels[configuredLevel] < constants_1.NumericLogLevels[level])
105
- return;
106
125
  const formatted = this.createLog(level, msg, error);
107
126
  const methodName = toPinoLevel(level);
108
- const target = this.activePino();
109
- const emitter = target[methodName];
127
+ const emitter = this.pino[methodName];
110
128
  if (typeof emitter === "function") {
111
- emitter.call(target, formatted);
129
+ emitter.call(this.pino, formatted);
112
130
  return;
113
131
  }
114
- if (typeof target["log"] === "function") {
115
- target.log({
132
+ if (typeof this.pino.log === "function") {
133
+ this.pino.log({
116
134
  level: methodName,
117
135
  msg: formatted,
118
136
  });
119
- return;
120
137
  }
121
138
  }
122
139
  fatal(msg, error) {
123
140
  const formatted = this.createLog(constants_1.LogLevel.error, msg, error);
124
- const target = this.activePino();
125
- const fatal = target.fatal;
141
+ const fatal = this.pino.fatal;
126
142
  if (typeof fatal === "function") {
127
- fatal.call(target, formatted);
143
+ fatal.call(this.pino, formatted);
128
144
  }
129
145
  else {
130
146
  this.error(msg, error);
@@ -136,42 +152,28 @@ class PinoLogger extends logging_1.MiniLogger {
136
152
  : typeof bindings.name === "string"
137
153
  ? bindings.name
138
154
  : undefined;
139
- const combinedContext = nextContext
140
- ? [this.context, nextContext].join(this.config("contextSeparator"))
141
- : this.context;
142
- const key = combinedContext;
143
- let childPino = this.childLoggers.get(key);
144
- if (!childPino) {
145
- childPino =
146
- typeof this.pino.child === "function"
147
- ? this.pino.child(bindings, options)
148
- : this.pino;
149
- this.childLoggers.set(key, childPino);
150
- }
151
- const baseConfig = getPinoConfig(logging_1.Logging.getConfig(), this.conf);
152
- const overrides = {
153
- pino: mergePinoConfig(baseConfig, { instance: childPino }),
154
- };
155
- if (nextContext) {
156
- return super.for(nextContext, overrides);
157
- }
158
- return super.for(overrides);
155
+ const childInstance = typeof this.pino.child === "function"
156
+ ? this.pino.child(bindings, options)
157
+ : this.pino;
158
+ const childLogger = new PinoLogger(nextContext ??
159
+ joinContext(this.context, this.config("contextSeparator") || "."), this.conf, childInstance);
160
+ childLogger.context = nextContext
161
+ ? [...this.context, nextContext]
162
+ : [...this.context];
163
+ return childLogger;
159
164
  }
160
165
  flush() {
161
- const target = this.activePino();
162
- if (typeof target.flush === "function") {
163
- return target.flush();
166
+ if (typeof this.pino.flush === "function") {
167
+ return this.pino.flush();
164
168
  }
165
169
  }
166
170
  get level() {
167
- const target = this.activePino();
168
- return target.level;
171
+ return this.pino.level;
169
172
  }
170
173
  set level(value) {
171
174
  if (!value)
172
175
  return;
173
- const target = this.activePino();
174
- target.level = value;
176
+ this.pino.level = value;
175
177
  const mapped = fromPinoLevel(value);
176
178
  if (mapped)
177
179
  this.setConfig({ level: mapped });
@@ -179,40 +181,14 @@ class PinoLogger extends logging_1.MiniLogger {
179
181
  }
180
182
  exports.PinoLogger = PinoLogger;
181
183
  /**
182
- * @description Factory function returning a Pino-backed logger.
183
- * @summary Allows registering the Pino logger with the global Logging facade.
184
+ * @description A factory for creating {@link PinoLogger} instances.
185
+ * @summary This factory function creates a new {@link PinoLogger} instance, and can optionally accept a pre-existing Pino logger instance.
186
+ * @const {LoggerFactory} PinoFactory
187
+ * @memberOf module:Logging
184
188
  */
185
189
  const PinoFactory = (context, conf, ...args) => {
186
- const shallowClone = conf
187
- ? {
188
- ...conf,
189
- pino: conf.pino ? { ...conf.pino } : undefined,
190
- }
191
- : {};
192
- const normalized = shallowClone;
193
- const ensurePinoConfig = () => {
194
- const current = normalized.pino;
195
- if (current)
196
- return current;
197
- const fresh = {};
198
- normalized.pino = fresh;
199
- return fresh;
200
- };
201
- const [firstArg, secondArg] = args;
202
- if (isPinoLogger(firstArg)) {
203
- const pinoConfig = ensurePinoConfig();
204
- pinoConfig.instance = firstArg;
205
- }
206
- else if (firstArg) {
207
- const pinoConfig = ensurePinoConfig();
208
- pinoConfig.options = {
209
- ...(pinoConfig.options || {}),
210
- ...firstArg,
211
- };
212
- if (secondArg !== undefined)
213
- pinoConfig.destination = secondArg;
214
- }
215
- return new PinoLogger(context, normalized);
190
+ const [driver] = args;
191
+ return new PinoLogger(context, conf, driver);
216
192
  };
217
193
  exports.PinoFactory = PinoFactory;
218
194
  //# sourceMappingURL=pino.js.map
@@ -2,11 +2,17 @@ import { Logger as PinoBaseLogger } from "pino";
2
2
  import { MiniLogger } from "../logging";
3
3
  import { Logger, LoggerFactory, LoggingConfig, StringLike } from "../types";
4
4
  import { LogLevel } from "../constants";
5
+ /**
6
+ * @description A logger that is powered by the Pino logging library.
7
+ * @summary This class extends {@link MiniLogger} and uses Pino as its underlying logging engine.
8
+ * @param {string} [context] - The context (typically the class name) that this logger is associated with.
9
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
10
+ * @param {PinoBaseLogger} [driver] - An optional, pre-existing Pino logger instance to use.
11
+ * @class PinoLogger
12
+ */
5
13
  export declare class PinoLogger extends MiniLogger implements Logger {
6
14
  protected pino: PinoBaseLogger;
7
- private readonly childLoggers;
8
- constructor(context: string, conf?: Partial<LoggingConfig>);
9
- private activePino;
15
+ constructor(context?: string, conf?: Partial<LoggingConfig>, driver?: PinoBaseLogger);
10
16
  protected log(level: LogLevel, msg: StringLike | Error, error?: Error): void;
11
17
  fatal(msg: StringLike | Error, error?: Error): void;
12
18
  child(bindings?: Record<string, unknown>, options?: Record<string, unknown>): PinoLogger;
@@ -15,7 +21,9 @@ export declare class PinoLogger extends MiniLogger implements Logger {
15
21
  set level(value: string | undefined);
16
22
  }
17
23
  /**
18
- * @description Factory function returning a Pino-backed logger.
19
- * @summary Allows registering the Pino logger with the global Logging facade.
24
+ * @description A factory for creating {@link PinoLogger} instances.
25
+ * @summary This factory function creates a new {@link PinoLogger} instance, and can optionally accept a pre-existing Pino logger instance.
26
+ * @const {LoggerFactory} PinoFactory
27
+ * @memberOf module:Logging
20
28
  */
21
29
  export declare const PinoFactory: LoggerFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"pino.js","sourceRoot":"","sources":["../../src/pino/pino.ts"],"names":[],"mappings":";;;;;;AAAA,gDAIc;AACd,8CAAiD;AAEjD,kDAA0D;AAI1D,MAAM,cAAc,GAAoC;IACtD,CAAC,oBAAQ,CAAC,SAAS,CAAC,EAAE,MAAM;IAC5B,CAAC,oBAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,oBAAQ,CAAC,OAAO,CAAC,EAAE,OAAO;IAC3B,CAAC,oBAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,oBAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,oBAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;CAC1B,CAAC;AAEF,MAAM,cAAc,GAA6C;IAC/D,KAAK,EAAE,oBAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,oBAAQ,CAAC,KAAK;IACrB,IAAI,EAAE,oBAAQ,CAAC,IAAI;IACnB,IAAI,EAAE,oBAAQ,CAAC,IAAI;IACnB,KAAK,EAAE,oBAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,oBAAQ,CAAC,KAAK;CACtB,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,SAAmB,EAA+B,EAAE;IACxE,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;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IAChD,CAAC;CACF;AA/GD,gCA+GC;AAED;;;;;GAKG;AACI,MAAM,WAAW,GAAkB,CACxC,OAAgB,EAChB,IAA6B,EAC7B,GAAG,IAAW,EACd,EAAE;IACF,MAAM,CAAC,MAAM,CAAC,GAAG,IAAoC,CAAC;IACtD,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB"}
package/lib/text.cjs CHANGED
@@ -14,17 +14,13 @@ exports.sf = sf;
14
14
  const constants_1 = require("./constants.cjs");
15
15
  /**
16
16
  * @description Pads the end of a string with a specified character.
17
- * @summary Extends the input string to a specified length by adding a padding character to the end.
18
- * If the input string is already longer than the specified length, it is returned unchanged.
19
- *
17
+ * @summary This function extends the input string to a specified length by adding a padding character to the end. If the input string is already longer than the specified length, it is returned unchanged.
20
18
  * @param {string} str - The input string to be padded.
21
19
  * @param {number} length - The desired total length of the resulting string.
22
- * @param {string} [char=" "] - The character to use for padding. Defaults to a space.
20
+ * @param {string} [char=" "] - The character to use for padding.
23
21
  * @return {string} The padded string.
24
22
  * @throws {Error} If the padding character is not exactly one character long.
25
- *
26
23
  * @function padEnd
27
- *
28
24
  * @memberOf module:Logging
29
25
  */
30
26
  function padEnd(str, length, char = " ") {
@@ -33,20 +29,15 @@ function padEnd(str, length, char = " ") {
33
29
  return str.padEnd(length, char);
34
30
  }
35
31
  /**
36
- * @description Replaces placeholders in a string with provided values.
37
- * @summary Interpolates a string by replacing placeholders of the form ${variableName}
38
- * with corresponding values from the provided object. If a placeholder doesn't have
39
- * a corresponding value, it is left unchanged in the string.
40
- *
41
- * @param {string} input - The input string containing placeholders to be replaced.
42
- * @param {Record<string, number | string>} values - An object containing key-value pairs for replacement.
43
- * @param prefix
44
- * @param suffix
45
- * @param flags
46
- * @return {string} The interpolated string with placeholders replaced by their corresponding values.
47
- *
32
+ * @description Replaces placeholders in a string with the provided values.
33
+ * @summary This function interpolates a string by replacing placeholders of the form `${variableName}` with the corresponding values from the provided object. If a placeholder does not have a corresponding value, it is left unchanged in the string.
34
+ * @param {string} input - The input string containing the placeholders to be replaced.
35
+ * @param {Record<string, (number|string)>} values - An object containing key-value pairs for the replacement.
36
+ * @param {string} [prefix="${"] - The prefix for the placeholders.
37
+ * @param {string} [suffix="}"] - The suffix for the placeholders.
38
+ * @param {string} [flags="g"] - The regular expression flags to use.
39
+ * @return {string} The interpolated string with the placeholders replaced by their corresponding values.
48
40
  * @function patchPlaceholders
49
- *
50
41
  * @mermaid
51
42
  * sequenceDiagram
52
43
  * participant Caller
@@ -56,7 +47,6 @@ function padEnd(str, length, char = " ") {
56
47
  * patchString->>String.replace: Call with regex and replacement function
57
48
  * String.replace->>patchString: Return replaced string
58
49
  * patchString-->>Caller: Return patched string
59
- *
60
50
  * @memberOf module:Logging
61
51
  */
62
52
  function patchPlaceholders(input, values, prefix = constants_1.DefaultPlaceholderWrappers[0], suffix = constants_1.DefaultPlaceholderWrappers[1], flags = "g") {
@@ -68,16 +58,12 @@ function patchPlaceholders(input, values, prefix = constants_1.DefaultPlaceholde
68
58
  }
69
59
  /**
70
60
  * @description Replaces occurrences of keys with their corresponding values in a string.
71
- * @summary Iterates through a set of key-value pairs and replaces all occurrences of each key
72
- * in the input string with its corresponding value. Supports regular expression flags for customized replacement.
73
- *
74
- * @param {string} input - The input string in which replacements will be made.
75
- * @param {Record<string, number | string>} values - An object containing key-value pairs for replacement.
76
- * @param {string} [flags="g"] - Regular expression flags to control the replacement behavior.
77
- * @return {string} The string with all specified replacements applied.
78
- *
61
+ * @summary This function iterates through a set of key-value pairs and replaces all occurrences of each key in the input string with its corresponding value. It supports regular expression flags for customized replacement.
62
+ * @param {string} input - The input string in which the replacements will be made.
63
+ * @param {Record<string, (number|string)>} values - An object containing key-value pairs for the replacement.
64
+ * @param {string} [flags="g"] - The regular expression flags to control the replacement behavior.
65
+ * @return {string} The string with all the specified replacements applied.
79
66
  * @function patchString
80
- *
81
67
  * @memberOf module:Logging
82
68
  */
83
69
  function patchString(input, values, flags = "g") {
@@ -89,14 +75,10 @@ function patchString(input, values, flags = "g") {
89
75
  }
90
76
  /**
91
77
  * @description Converts a string to camelCase.
92
- * @summary Transforms the input string into camelCase format, where words are joined without spaces
93
- * and each word after the first starts with a capital letter.
94
- *
78
+ * @summary This function transforms the input string into camelCase format, where words are joined without spaces and each word after the first starts with a capital letter.
95
79
  * @param {string} text - The input string to be converted.
96
80
  * @return {string} The input string converted to camelCase.
97
- *
98
81
  * @function toCamelCase
99
- *
100
82
  * @memberOf module:Logging
101
83
  */
102
84
  function toCamelCase(text) {
@@ -106,14 +88,10 @@ function toCamelCase(text) {
106
88
  }
107
89
  /**
108
90
  * @description Converts a string to ENVIRONMENT_VARIABLE format.
109
- * @summary Transforms the input string into uppercase with words separated by underscores,
110
- * typically used for environment variable names.
111
- *
91
+ * @summary This function transforms the input string into uppercase with words separated by underscores, which is a format that is typically used for environment variable names.
112
92
  * @param {string} text - The input string to be converted.
113
93
  * @return {string} The input string converted to ENVIRONMENT_VARIABLE format.
114
- *
115
94
  * @function toENVFormat
116
- *
117
95
  * @memberOf module:Logging
118
96
  */
119
97
  function toENVFormat(text) {
@@ -121,13 +99,10 @@ function toENVFormat(text) {
121
99
  }
122
100
  /**
123
101
  * @description Converts a string to snake_case.
124
- * @summary Transforms the input string into lowercase with words separated by underscores.
125
- *
102
+ * @summary This function transforms the input string into lowercase with words separated by underscores.
126
103
  * @param {string} text - The input string to be converted.
127
104
  * @return {string} The input string converted to snake_case.
128
- *
129
105
  * @function toSnakeCase
130
- *
131
106
  * @memberOf module:Logging
132
107
  */
133
108
  function toSnakeCase(text) {
@@ -138,13 +113,10 @@ function toSnakeCase(text) {
138
113
  }
139
114
  /**
140
115
  * @description Converts a string to kebab-case.
141
- * @summary Transforms the input string into lowercase with words separated by hyphens.
142
- *
116
+ * @summary This function transforms the input string into lowercase with words separated by hyphens.
143
117
  * @param {string} text - The input string to be converted.
144
118
  * @return {string} The input string converted to kebab-case.
145
- *
146
119
  * @function toKebabCase
147
- *
148
120
  * @memberOf module:Logging
149
121
  */
150
122
  function toKebabCase(text) {
@@ -155,14 +127,10 @@ function toKebabCase(text) {
155
127
  }
156
128
  /**
157
129
  * @description Converts a string to PascalCase.
158
- * @summary Transforms the input string into PascalCase format, where words are joined without spaces
159
- * and each word starts with a capital letter.
160
- *
130
+ * @summary This function transforms the input string into PascalCase format, where words are joined without spaces and each word starts with a capital letter.
161
131
  * @param {string} text - The input string to be converted.
162
132
  * @return {string} The input string converted to PascalCase.
163
- *
164
133
  * @function toPascalCase
165
- *
166
134
  * @memberOf module:Logging
167
135
  */
168
136
  function toPascalCase(text) {
@@ -172,26 +140,21 @@ function toPascalCase(text) {
172
140
  }
173
141
  /**
174
142
  * @description Escapes special characters in a string for use in a regular expression.
175
- * @summary Adds backslashes before characters that have special meaning in regular expressions,
176
- * allowing the string to be used as a literal match in a RegExp.
177
- *
143
+ * @summary This function adds backslashes before characters that have a special meaning in regular expressions, which allows the string to be used as a literal match in a RegExp.
178
144
  * @param {string} string - The string to escape for regular expression use.
179
- * @return {string} The escaped string safe for use in regular expressions.
180
- *
145
+ * @return {string} The escaped string that is safe for use in regular expressions.
181
146
  * @function escapeRegExp
182
- *
183
147
  * @memberOf module:Logging
184
148
  */
185
149
  function escapeRegExp(string) {
186
150
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
187
151
  }
188
152
  /**
189
- * @summary Util function to provide string format functionality similar to C#'s string.format
190
- *
191
- * @param {string} string
192
- * @param {Array<string | number> | Record<string, any>} [args] replacements made by order of appearance (replacement0 wil replace {0} and so on)
193
- * @return {string} formatted string
194
- *
153
+ * @description A utility function that provides string formatting functionality that is similar to C#'s string.format.
154
+ * @summary This function replaces placeholders in a string with the provided arguments.
155
+ * @param {string} string - The string to format.
156
+ * @param {...(string|number|Record<string, any>)} args - The arguments to use for formatting.
157
+ * @return {string} The formatted string.
195
158
  * @function sf
196
159
  * @memberOf module:Logging
197
160
  */
@@ -215,10 +178,9 @@ function sf(string, ...args) {
215
178
  });
216
179
  }
217
180
  /**
218
- * @summary Util function to provide string format functionality similar to C#'s string.format
219
- *
181
+ * @description A utility function that provides string formatting functionality that is similar to C#'s string.format.
182
+ * @summary This function is deprecated. Use {@link sf} instead.
220
183
  * @see sf
221
- *
222
184
  * @deprecated
223
185
  * @function stringFormat
224
186
  * @memberOf module:Logging