@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
@@ -1,8 +1,8 @@
1
1
  import { styles } from "styled-string-builder";
2
2
  import { LoggingMode, LogLevel } from "./constants";
3
3
  /**
4
- * @description String-compatible value accepted by the logging APIs.
5
- * @summary Represents either a literal string or an object exposing a `toString()` method, allowing lazy stringification of complex payloads.
4
+ * @description A string-compatible value that can be accepted by the logging APIs.
5
+ * @summary Represents either a literal string or an object that has a `toString()` method. This allows for the lazy stringification of complex payloads.
6
6
  * @typedef {(string|Object)} StringLike
7
7
  * @memberOf module:Logging
8
8
  */
@@ -10,32 +10,32 @@ export type StringLike = string | {
10
10
  toString: () => string;
11
11
  };
12
12
  /**
13
- * @description Generic function signature for loosely typed callbacks.
14
- * @summary Covers variadic functions whose arguments and return types are not constrained, enabling the logging layer to accept any callable.
15
- * @typedef {function(any[]): any} AnyFunction
13
+ * @description A generic function signature for loosely typed callbacks.
14
+ * @summary This type covers variadic functions where the arguments and return types are not constrained, which enables the logging layer to accept any callable.
15
+ * @typedef {function(...any[]): any} AnyFunction
16
16
  * @memberOf module:Logging
17
17
  */
18
18
  export type AnyFunction = (...args: any[]) => any;
19
19
  /**
20
- * @description Constructable class type.
21
- * @summary Describes a constructor that produces instances of type `T`, allowing APIs to accept class references for context-aware logging.
20
+ * @description A constructable class type.
21
+ * @summary Describes a constructor that produces instances of type `T`. This allows APIs to accept class references for context-aware logging.
22
22
  * @template T
23
- * @typedef {any} Class
23
+ * @typedef Class
24
24
  * @memberOf module:Logging
25
25
  */
26
26
  export type Class<T> = {
27
27
  new (...args: any[]): T;
28
28
  };
29
29
  /**
30
- * @description Context descriptor accepted when requesting a logger instance.
30
+ * @description A context descriptor that is accepted when requesting a logger instance.
31
31
  * @summary Allows the logging system to resolve context names from strings, constructors, or functions.
32
- * @typedef {(string|Function|Object)} LoggingContext
32
+ * @typedef {(string|Class<any>|AnyFunction)} LoggingContext
33
33
  * @memberOf module:Logging
34
34
  */
35
35
  export type LoggingContext = string | Class<any> | AnyFunction;
36
36
  /**
37
- * @description Interface for factories that create contextual clones of the receiver.
38
- * @summary Declares a `for` method that returns another instance of `THIS` using the provided arguments, enabling chained logger customization.
37
+ * @description An interface for factories that create contextual clones of the receiver.
38
+ * @summary Declares a `for` method that returns another instance of `THIS` using the provided arguments. This enables chained logger customization.
39
39
  * @template THIS
40
40
  * @template ARGS
41
41
  * @interface Impersonatable
@@ -45,16 +45,14 @@ export interface Impersonatable<THIS, ARGS extends any[] = any[]> {
45
45
  /**
46
46
  * @description Produce a copy of the current instance with altered context.
47
47
  * @summary Called by logging utilities to derive child objects with supplemental configuration and context metadata.
48
- * @template THIS
49
- * @template ARGS
50
48
  * @param {ARGS} args - Arguments forwarded to the impersonation strategy.
51
49
  * @return {THIS} Derived instance using the provided arguments.
52
50
  */
53
51
  for(...args: ARGS): THIS;
54
52
  }
55
53
  /**
56
- * @description Interface for loggers that support multiple verbosity levels.
57
- * @summary Declares severity-specific log methods, configuration overrides, and factory helpers used throughout the logging toolkit.
54
+ * @description An interface for loggers that support multiple verbosity levels.
55
+ * @summary This interface declares severity-specific log methods, configuration overrides, and factory helpers that are used throughout the logging toolkit.
58
56
  * @interface Logger
59
57
  * @memberOf module:Logging
60
58
  */
@@ -131,13 +129,19 @@ export interface Logger extends Impersonatable<Logger, [
131
129
  * @param {...any[]} args - Extra arguments forwarded to factory implementations.
132
130
  * @return {Logger} Logger instance tailored to the supplied context.
133
131
  */
134
- for(config: Partial<LoggingConfig>): Logger;
132
+ for(config: Partial<LoggingConfig>): this;
135
133
  for(context: string | {
136
134
  new (...args: any[]): any;
137
- } | AnyFunction | object): Logger;
135
+ } | AnyFunction | object): this;
138
136
  for(method: string | {
139
137
  new (...args: any[]): any;
140
- } | AnyFunction | object | Partial<LoggingConfig>, config?: Partial<LoggingConfig>, ...args: any[]): Logger;
138
+ } | AnyFunction | object | Partial<LoggingConfig>, config?: Partial<LoggingConfig>, ...args: any[]): this;
139
+ /**
140
+ * @description Clears any contextual overrides applied via {@link Logger.for}.
141
+ * @summary Resets temporary context/configuration so ensuing chains start from the base logger while preserving the concrete instance type.
142
+ * @return {this} The same logger instance to continue chaining.
143
+ */
144
+ clear(): this;
141
145
  /**
142
146
  * @description Updates the logger configuration.
143
147
  * @summary Merges the given options into the logger's existing configuration.
@@ -145,10 +149,15 @@ export interface Logger extends Impersonatable<Logger, [
145
149
  * @return {void}
146
150
  */
147
151
  setConfig(config: Partial<LoggingConfig>): void;
152
+ /**
153
+ * @description Immutable base context for the logger instance.
154
+ * @summary Returned as a copy so callers cannot mutate the internal base context while still allowing inspection.
155
+ */
156
+ readonly root: string[];
148
157
  }
149
158
  /**
150
- * @description Interface for filters that mutate or reject log messages.
151
- * @summary Allows custom pre-processing of log entries before they are formatted or emitted.
159
+ * @description An interface for filters that can mutate or reject log messages.
160
+ * @summary This allows for custom pre-processing of log entries before they are formatted or emitted.
152
161
  * @interface LoggingFilter
153
162
  * @memberOf module:Logging
154
163
  */
@@ -164,25 +173,29 @@ export interface LoggingFilter {
164
173
  filter(config: LoggingConfig, message: string, context: string[]): string;
165
174
  }
166
175
  /**
167
- * @description Configuration for logging.
168
- * @summary Defines the log level and verbosity for logging.
169
- * @typedef {Object} LoggingConfig
176
+ * @description Configuration for the logging system.
177
+ * @summary Defines the log level, verbosity, and other settings for logging.
178
+ * @template TRANSPORT
179
+ * @typedef {object} LoggingConfig
180
+ * @property {string} env - The environment, e.g., "development", "production".
170
181
  * @property {LogLevel} level - The logging level.
171
- * @property {boolean} [logLevel] - Whether to display log level in output.
182
+ * @property {boolean} [logLevel] - Whether to display the log level in the output.
172
183
  * @property {number} verbose - The verbosity level.
173
- * @property {LoggingMode} [mode] - Output format mode.
174
- * @property {string} contextSeparator - Separator between context entries.
175
- * @property {string} separator - Separator between log components.
176
- * @property {boolean} [style] - Whether to apply styling to log output.
184
+ * @property {string} contextSeparator - The separator to use between context entries.
185
+ * @property {string} separator - The separator to use between log components.
186
+ * @property {boolean} [style] - Whether to apply styling to the log output.
177
187
  * @property {boolean} [timestamp] - Whether to include timestamps in log messages.
178
- * @property {string} [timestampFormat] - Format for timestamps.
188
+ * @property {string} [timestampFormat] - The format for timestamps.
179
189
  * @property {boolean} [context] - Whether to include context information in log messages.
180
190
  * @property {Theme} [theme] - The theme to use for styling log messages.
181
- * @property {string|number} [correlationId] - Correlation ID for tracking related log messages.
191
+ * @property {LoggingMode} format - The output format for log messages.
192
+ * @property {string} pattern - The pattern to use for formatting log messages.
193
+ * @property {(string|number)} [correlationId] - A correlation ID for tracking related log messages.
194
+ * @property {(string[]|LoggingFilter[])} [filters] - An array of filters to apply to log messages.
195
+ * @property {TRANSPORT[]} [transports] - An array of transports to use for logging.
182
196
  * @memberOf module:Logging
183
197
  */
184
- export type LoggingConfig = {
185
- app?: string;
198
+ export type LoggingConfig<TRANSPORT = object> = {
186
199
  env: "development" | "production" | "test" | "staging" | string;
187
200
  level: LogLevel;
188
201
  logLevel?: boolean;
@@ -198,23 +211,19 @@ export type LoggingConfig = {
198
211
  pattern: string;
199
212
  correlationId?: string | number;
200
213
  filters?: string[] | LoggingFilter[];
201
- pino?: {
202
- instance?: unknown;
203
- options?: unknown;
204
- destination?: unknown;
205
- };
214
+ transports?: TRANSPORT[];
206
215
  };
207
216
  /**
208
- * @description Factory signature for creating logger instances.
209
- * @summary Allows consumers to override logger construction with custom implementations.
210
- * @template L - The logger type, extending the base Logger interface
211
- * @typedef {function(string, Partial<LoggingConfig>, any[]): L} LoggerFactory
217
+ * @description A factory signature for creating logger instances.
218
+ * @summary This allows consumers to override the logger construction with custom implementations.
219
+ * @template L
220
+ * @typedef {function(string, Partial<LoggingConfig>, ...any[]): L} LoggerFactory
212
221
  * @memberOf module:Logging
213
222
  */
214
- export type LoggerFactory<L extends Logger = Logger> = (object: string, config?: Partial<LoggingConfig>, ...args: any[]) => L;
223
+ export type LoggerFactory<L extends Logger = Logger> = (object?: string, config?: Partial<LoggingConfig>, ...args: any[]) => L;
215
224
  /**
216
- * @description Theme option applied to a specific log element.
217
- * @summary Configures foreground and background colors as well as additional style directives for styled console output.
225
+ * @description A theme option that is applied to a specific log element.
226
+ * @summary This interface configures the foreground and background colors, as well as additional style directives for styled console output.
218
227
  * @interface ThemeOption
219
228
  * @memberOf module:Logging
220
229
  */
@@ -224,15 +233,15 @@ export interface ThemeOption {
224
233
  style?: number[] | [keyof typeof styles];
225
234
  }
226
235
  /**
227
- * @description Mapping between log levels and theme overrides.
228
- * @summary Enables level-specific styling by associating each {@link LogLevel} with a {@link ThemeOption} configuration.
229
- * @typedef {Object} ThemeOptionByLogLevel
236
+ * @description A mapping between log levels and theme overrides.
237
+ * @summary This enables level-specific styling by associating each {@link LogLevel} with a {@link ThemeOption} configuration.
238
+ * @typedef {Partial<Record<LogLevel, ThemeOption>>} ThemeOptionByLogLevel
230
239
  * @memberOf module:Logging
231
240
  */
232
241
  export type ThemeOptionByLogLevel = Partial<Record<LogLevel, ThemeOption>>;
233
242
  /**
234
- * @description Theme definition applied to console output.
235
- * @summary Specifies styling for each console log element and supports overrides based on {@link LogLevel} values.
243
+ * @description A theme definition that is applied to the console output.
244
+ * @summary This interface specifies the styling for each console log element and supports overrides based on {@link LogLevel} values.
236
245
  * @interface Theme
237
246
  * @memberOf module:Logging
238
247
  */
@@ -1,5 +1,48 @@
1
+ /**
2
+ * @description Checks if a value is a class.
3
+ * @summary This function determines if the given value is a class constructor.
4
+ * @param {unknown} value - The value to check.
5
+ * @return {boolean} `true` if the value is a class, `false` otherwise.
6
+ * @function isClass
7
+ * @memberOf module:Logging
8
+ */
1
9
  export declare function isClass(value: unknown): value is abstract new (...args: any[]) => any;
10
+ /**
11
+ * @description Checks if a value is a function.
12
+ * @summary This function determines if the given value is a function, but not a class.
13
+ * @template T
14
+ * @param {unknown} value - The value to check.
15
+ * @return {boolean} `true` if the value is a function, `false` otherwise.
16
+ * @function isFunction
17
+ * @memberOf module:Logging
18
+ */
2
19
  export declare function isFunction<T extends (...args: any[]) => unknown>(value: unknown): value is T;
20
+ /**
21
+ * @description Checks if a value is a method.
22
+ * @summary This function determines if the given value is a method.
23
+ * @template T
24
+ * @param {unknown} value - The value to check.
25
+ * @return {boolean} `true` if the value is a method, `false` otherwise.
26
+ * @function isMethod
27
+ * @memberOf module:Logging
28
+ */
3
29
  export declare function isMethod<T extends (...args: any[]) => unknown>(value: unknown): value is T;
30
+ /**
31
+ * @description Checks if a value is an instance of a class.
32
+ * @summary This function determines if the given value is an instance of a class.
33
+ * @template T
34
+ * @param {unknown} value - The value to check.
35
+ * @return {boolean} `true` if the value is an instance of a class, `false` otherwise.
36
+ * @function isInstance
37
+ * @memberOf module:Logging
38
+ */
4
39
  export declare function isInstance<T extends object>(value: unknown): value is T;
40
+ /**
41
+ * @description Gets the name of an object.
42
+ * @summary This function returns the name of the given object, which can be a class, an instance of a class, a function, or a primitive value.
43
+ * @param {unknown} value - The value to get the name of.
44
+ * @return {string} The name of the object.
45
+ * @function getObjectName
46
+ * @memberOf module:Logging
47
+ */
5
48
  export declare function getObjectName(value: unknown): string;
package/lib/esm/utils.js CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * @description Checks if a value is a class.
3
+ * @summary This function determines if the given value is a class constructor.
4
+ * @param {unknown} value - The value to check.
5
+ * @return {boolean} `true` if the value is a class, `false` otherwise.
6
+ * @function isClass
7
+ * @memberOf module:Logging
8
+ */
1
9
  export function isClass(value) {
2
10
  if (typeof value !== "function")
3
11
  return false;
@@ -27,15 +35,42 @@ export function isClass(value) {
27
35
  const names = Object.getOwnPropertyNames(proto).filter((n) => n !== "constructor");
28
36
  return names.length > 0;
29
37
  }
38
+ /**
39
+ * @description Checks if a value is a function.
40
+ * @summary This function determines if the given value is a function, but not a class.
41
+ * @template T
42
+ * @param {unknown} value - The value to check.
43
+ * @return {boolean} `true` if the value is a function, `false` otherwise.
44
+ * @function isFunction
45
+ * @memberOf module:Logging
46
+ */
30
47
  export function isFunction(value) {
31
48
  return typeof value === "function" && !isClass(value);
32
49
  }
50
+ /**
51
+ * @description Checks if a value is a method.
52
+ * @summary This function determines if the given value is a method.
53
+ * @template T
54
+ * @param {unknown} value - The value to check.
55
+ * @return {boolean} `true` if the value is a method, `false` otherwise.
56
+ * @function isMethod
57
+ * @memberOf module:Logging
58
+ */
33
59
  export function isMethod(value) {
34
60
  if (!isFunction(value))
35
61
  return false;
36
62
  const descriptor = Object.getOwnPropertyDescriptor(value, "prototype");
37
63
  return !descriptor || descriptor.value === undefined;
38
64
  }
65
+ /**
66
+ * @description Checks if a value is an instance of a class.
67
+ * @summary This function determines if the given value is an instance of a class.
68
+ * @template T
69
+ * @param {unknown} value - The value to check.
70
+ * @return {boolean} `true` if the value is an instance of a class, `false` otherwise.
71
+ * @function isInstance
72
+ * @memberOf module:Logging
73
+ */
39
74
  export function isInstance(value) {
40
75
  if (value === null || typeof value !== "object")
41
76
  return false;
@@ -45,6 +80,14 @@ export function isInstance(value) {
45
80
  return false;
46
81
  return isClass(ctor);
47
82
  }
83
+ /**
84
+ * @description Gets the name of an object.
85
+ * @summary This function returns the name of the given object, which can be a class, an instance of a class, a function, or a primitive value.
86
+ * @param {unknown} value - The value to get the name of.
87
+ * @return {string} The name of the object.
88
+ * @function getObjectName
89
+ * @memberOf module:Logging
90
+ */
48
91
  export function getObjectName(value) {
49
92
  if (value === null)
50
93
  return "null";
@@ -56,6 +99,18 @@ export function getObjectName(value) {
56
99
  return value.name || "AnonymousClass";
57
100
  }
58
101
  if (isInstance(value)) {
102
+ const toStringFn = value.toString;
103
+ if (typeof toStringFn === "function" &&
104
+ toStringFn !== Object.prototype.toString) {
105
+ try {
106
+ const rendered = toStringFn.call(value);
107
+ if (typeof rendered === "string" && rendered.length)
108
+ return rendered;
109
+ }
110
+ catch {
111
+ // ignore custom toString errors and fall back to constructor name.
112
+ }
113
+ }
59
114
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
60
115
  const ctor = value.constructor;
61
116
  return ctor && ctor.name ? ctor.name : "AnonymousInstance";
@@ -65,9 +120,6 @@ export function getObjectName(value) {
65
120
  const fn = value;
66
121
  if (fn.name)
67
122
  return fn.name;
68
- const src = Function.prototype.toString.call(fn).trim();
69
- if (src)
70
- return src.split("\n")[0];
71
123
  return "anonymous";
72
124
  }
73
125
  if (typeof value === "object") {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CACrB,KAAc;IAEd,IAAI,OAAO,KAAK,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAE9C,kCAAkC;IAClC,yDAAyD;IACzD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,8DAA8D;IAChE,CAAC;IAED,oEAAoE;IACpE,MAAM,SAAS,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACtE,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IAEjD,kEAAkE;IAClE,gEAAgE;IAChE,IAAI,SAAS,CAAC,QAAQ,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAE9C,8CAA8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CAAC,CAAC;gBACxC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM;oBAAE,OAAO,QAAQ,CAAC;YACvE,CAAC;YAAC,MAAM,CAAC;gBACP,mEAAmE;YACrE,CAAC;QACH,CAAC;QACD,sEAAsE;QACtE,MAAM,IAAI,GAAI,KAAoC,CAAC,WAAW,CAAC;QAC/D,OAAO,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC7D,CAAC;IAED,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,sEAAsE;QACtE,MAAM,EAAE,GAAG,KAAiB,CAAC;QAC7B,IAAI,EAAE,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC;QAC5B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,OAAO,KAAK,CAAC;AACtB,CAAC"}
package/lib/esm/web.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @description Determines if the current environment is a browser by checking the prototype chain of the global object.
3
- * @summary Checks if the code is running in a browser environment.
4
- * @return {boolean} True if the environment is a browser, false otherwise.
3
+ * @summary This function checks if the code is running in a browser environment.
4
+ * @return {boolean} `true` if the environment is a browser, `false` otherwise.
5
5
  * @function isBrowser
6
6
  * @memberOf module:Logging
7
7
  */
package/lib/esm/web.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @description Determines if the current environment is a browser by checking the prototype chain of the global object.
3
- * @summary Checks if the code is running in a browser environment.
4
- * @return {boolean} True if the environment is a browser, false otherwise.
3
+ * @summary This function checks if the code is running in a browser environment.
4
+ * @return {boolean} `true` if the environment is a browser, `false` otherwise.
5
5
  * @function isBrowser
6
6
  * @memberOf module:Logging
7
7
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @module Winston
3
+ * @description This module provides an adapter for the Winston logger.
4
+ * @summary This module exports the {@link WinstonLogger} class.
5
+ * @memberOf module:Logging
6
+ */
7
+ export * from "./winston";
@@ -1,2 +1,8 @@
1
- "use strict";
1
+ /**
2
+ * @module Winston
3
+ * @description This module provides an adapter for the Winston logger.
4
+ * @summary This module exports the {@link WinstonLogger} class.
5
+ * @memberOf module:Logging
6
+ */
7
+ export * from "./winston.js";
2
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/winston/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/winston/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,6BAA0B"}
@@ -1,15 +1,12 @@
1
1
  import winston from "winston";
2
- import Transport from "winston-transport";
3
2
  import { Logger, LoggerFactory, LoggingConfig, StringLike } from "../types";
4
3
  import { MiniLogger } from "../logging";
5
4
  import { LogLevel } from "../constants";
6
5
  /**
7
- * @description A logger implementation using Winston
8
- * @summary WinstonLogger extends MiniLogger to provide logging functionality using the Winston library.
9
- * It configures Winston with appropriate transports and formats based on the logging configuration.
10
- * @param {string} cont - The context (typically class name) this logger is associated with
11
- * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings
12
- * @param {Transport[]|Transport} [transports] - Winston transports to use for logging
6
+ * @description A logger implementation that uses Winston.
7
+ * @summary This class extends {@link MiniLogger} to provide logging functionality using the Winston library. It configures Winston with the appropriate transports and formats based on the logging configuration.
8
+ * @param {string} [cont] - The context (typically the class name) that this logger is associated with.
9
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
13
10
  * @class WinstonLogger
14
11
  * @example
15
12
  * // Create a Winston logger for a class
@@ -24,28 +21,27 @@ import { LogLevel } from "../constants";
24
21
  * methodLogger.debug('Processing data...');
25
22
  */
26
23
  export declare class WinstonLogger extends MiniLogger implements Logger {
27
- protected transports?: (Transport[] | Transport) | undefined;
28
24
  protected winston: winston.Logger;
29
- constructor(cont: string, conf?: Partial<LoggingConfig>, transports?: (Transport[] | Transport) | undefined);
25
+ constructor(cont?: string, conf?: Partial<LoggingConfig>);
26
+ private resolveTransports;
30
27
  /**
31
- * @description Logs a message with the specified log level using Winston
32
- * @summary Overrides the base log method to use Winston for logging
33
- * @param {LogLevel} level - The log level of the message
34
- * @param {StringLike | Error} msg - The message to be logged or an Error object
35
- * @param {Error} [error] - Optional stack trace to include in the log
28
+ * @description Logs a message with the specified log level using Winston.
29
+ * @summary This method overrides the base log method to use Winston for logging.
30
+ * @param {LogLevel} level - The log level of the message.
31
+ * @param {(StringLike|Error)} msg - The message to be logged or an Error object.
32
+ * @param {Error} [error] - An optional stack trace to include in the log.
36
33
  * @return {void}
37
34
  */
38
35
  protected log(level: LogLevel, msg: StringLike | Error, error?: Error): void;
39
36
  }
40
37
  /**
41
- * @description Factory function for creating Winston loggers
42
- * @summary A LoggerFactory implementation that creates WinstonLogger instances
38
+ * @description A factory function for creating Winston loggers.
39
+ * @summary This is a {@link LoggerFactory} implementation that creates {@link WinstonLogger} instances.
40
+ * @param {string} [context] - The context (typically the class name) for the logger.
41
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
42
+ * @param {...any} _args - Additional arguments to pass to the WinstonLogger constructor.
43
+ * @return {WinstonLogger} A new WinstonLogger instance.
43
44
  * @const WinstonFactory
44
- * @type {LoggerFactory}
45
- * @param {string} context - The context (typically class name) for the logger
46
- * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings
47
- * @param {...any} args - Additional arguments to pass to the WinstonLogger constructor
48
- * @return {WinstonLogger} A new WinstonLogger instance
49
45
  * @memberOf module:Logging
50
46
  */
51
47
  export declare const WinstonFactory: LoggerFactory;
@@ -1,12 +1,10 @@
1
1
  import winston from "winston";
2
2
  import { Logging, MiniLogger } from "./../logging.js";
3
3
  /**
4
- * @description A logger implementation using Winston
5
- * @summary WinstonLogger extends MiniLogger to provide logging functionality using the Winston library.
6
- * It configures Winston with appropriate transports and formats based on the logging configuration.
7
- * @param {string} cont - The context (typically class name) this logger is associated with
8
- * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings
9
- * @param {Transport[]|Transport} [transports] - Winston transports to use for logging
4
+ * @description A logger implementation that uses Winston.
5
+ * @summary This class extends {@link MiniLogger} to provide logging functionality using the Winston library. It configures Winston with the appropriate transports and formats based on the logging configuration.
6
+ * @param {string} [cont] - The context (typically the class name) that this logger is associated with.
7
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
10
8
  * @class WinstonLogger
11
9
  * @example
12
10
  * // Create a Winston logger for a class
@@ -21,35 +19,29 @@ import { Logging, MiniLogger } from "./../logging.js";
21
19
  * methodLogger.debug('Processing data...');
22
20
  */
23
21
  export class WinstonLogger extends MiniLogger {
24
- constructor(cont, conf, transports) {
22
+ constructor(cont, conf) {
25
23
  super(cont, conf);
26
- this.transports = transports;
27
24
  const config = Object.assign({}, Logging.getConfig(), this.conf || {});
28
- const { level, context, style, timestamp, timestampFormat } = config;
29
- const formats = [winston.format.splat(), winston.format.simple()];
30
- if (timestamp)
31
- formats.unshift(winston.format.timestamp({ format: timestampFormat }));
32
- if (style)
33
- formats.unshift(winston.format.colorize());
34
- this.transports = this.transports || [
35
- new winston.transports.Console({
36
- format: winston.format.combine(...formats),
37
- }),
38
- ];
25
+ const transports = this.resolveTransports(config.transports || undefined);
26
+ const passThrough = winston.format.printf(({ message }) => typeof message === "string" ? message : JSON.stringify(message));
39
27
  const winstonConfig = {
40
- level: level,
41
- defaultMeta: context,
42
- format: winston.format.json(),
43
- transports: transports,
28
+ level: config.level,
29
+ transports,
30
+ format: passThrough,
44
31
  };
45
32
  this.winston = winston.createLogger(winstonConfig);
46
33
  }
34
+ resolveTransports(transports) {
35
+ if (transports && transports.length)
36
+ return transports;
37
+ return [new winston.transports.Console()];
38
+ }
47
39
  /**
48
- * @description Logs a message with the specified log level using Winston
49
- * @summary Overrides the base log method to use Winston for logging
50
- * @param {LogLevel} level - The log level of the message
51
- * @param {StringLike | Error} msg - The message to be logged or an Error object
52
- * @param {Error} [error] - Optional stack trace to include in the log
40
+ * @description Logs a message with the specified log level using Winston.
41
+ * @summary This method overrides the base log method to use Winston for logging.
42
+ * @param {LogLevel} level - The log level of the message.
43
+ * @param {(StringLike|Error)} msg - The message to be logged or an Error object.
44
+ * @param {Error} [error] - An optional stack trace to include in the log.
53
45
  * @return {void}
54
46
  */
55
47
  log(level, msg, error) {
@@ -63,15 +55,16 @@ export class WinstonLogger extends MiniLogger {
63
55
  }
64
56
  }
65
57
  /**
66
- * @description Factory function for creating Winston loggers
67
- * @summary A LoggerFactory implementation that creates WinstonLogger instances
58
+ * @description A factory function for creating Winston loggers.
59
+ * @summary This is a {@link LoggerFactory} implementation that creates {@link WinstonLogger} instances.
60
+ * @param {string} [context] - The context (typically the class name) for the logger.
61
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
62
+ * @param {...any} _args - Additional arguments to pass to the WinstonLogger constructor.
63
+ * @return {WinstonLogger} A new WinstonLogger instance.
68
64
  * @const WinstonFactory
69
- * @type {LoggerFactory}
70
- * @param {string} context - The context (typically class name) for the logger
71
- * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings
72
- * @param {...any} args - Additional arguments to pass to the WinstonLogger constructor
73
- * @return {WinstonLogger} A new WinstonLogger instance
74
65
  * @memberOf module:Logging
75
66
  */
76
- export const WinstonFactory = (context, conf, ...args) => new WinstonLogger(context, conf, ...args);
67
+ export const WinstonFactory = (context, conf,
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
+ ..._args) => new WinstonLogger(context, conf);
77
70
  //# sourceMappingURL=winston.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"winston.js","sourceRoot":"","sources":["../../../src/winston/winston.ts"],"names":[],"mappings":"AAAA,OAAO,OAAoC,MAAM,SAAS,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,wBAAmB;AAGjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAG3C,YACE,IAAY,EACZ,IAA6B,EACnB,UAAoC;QAE9C,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAFR,eAAU,GAAV,UAAU,CAA0B;QAG9C,MAAM,MAAM,GAAkB,MAAM,CAAC,MAAM,CACzC,EAAE,EACF,OAAO,CAAC,SAAS,EAAE,EACnB,IAAI,CAAC,IAAI,IAAI,EAAE,CAChB,CAAC;QACF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QAErE,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,SAAS;YACX,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;QACzE,IAAI,KAAK;YAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI;YACnC,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;gBAC7B,MAAM,EAAE,OAAO,CA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;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB,CAC3C,OAAgB,EAChB,IAA6B;AAC7B,6DAA6D;AAC7D,GAAG,KAAY,EACA,EAAE,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC"}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LogFilter = void 0;
4
4
  const LoggedClass_1 = require("./../LoggedClass.cjs");
5
5
  /**
6
- * @description Base class for message filters that plug into the logging pipeline.
7
- * @summary Extends {@link LoggedClass} to supply a scoped logger and defines the contract required by {@link LoggingFilter} implementers that transform or drop log messages before emission.
6
+ * @description A base class for message filters that can be plugged into the logging pipeline.
7
+ * @summary This class extends {@link LoggedClass} to supply a scoped logger, and defines the contract that is required by {@link LoggingFilter} implementers that transform or drop log messages before emission.
8
8
  * @class LogFilter
9
9
  * @example
10
10
  * class RedactSecretsFilter extends LogFilter {
@@ -28,9 +28,9 @@ const LoggedClass_1 = require("./../LoggedClass.cjs");
28
28
  */
29
29
  class LogFilter extends LoggedClass_1.LoggedClass {
30
30
  /**
31
- * @description Scoped logger that excludes other filters from the chain.
32
- * @summary Returns a child logger dedicated to the filter, preventing recursive filter invocation when emitting diagnostic messages.
33
- * @return {Logger} Context-aware logger for the filter instance.
31
+ * @description A scoped logger that excludes other filters from the chain.
32
+ * @summary This method returns a child logger that is dedicated to the filter, which prevents recursive filter invocation when emitting diagnostic messages.
33
+ * @return {Logger} A context-aware logger for the filter instance.
34
34
  */
35
35
  get log() {
36
36
  return super.log.for(this, { filters: [] });