logixia 1.13.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +81 -16
  2. package/dist/{async-context-CwBNMm2E.mjs → async-context-BzJrbfQs.mjs} +8 -4
  3. package/dist/async-context-BzJrbfQs.mjs.map +1 -0
  4. package/dist/{async-context-CSHWoHMB.js → async-context-DyQQYq3I.js} +8 -4
  5. package/dist/async-context-DyQQYq3I.js.map +1 -0
  6. package/dist/{azure-monitor.transport-CG7ClkYj.d.ts → azure-monitor.transport-Cn_3Usvu.d.ts} +2 -2
  7. package/dist/{azure-monitor.transport-CG7ClkYj.d.ts.map → azure-monitor.transport-Cn_3Usvu.d.ts.map} +1 -1
  8. package/dist/{azure-monitor.transport-Cm74kXZS.d.mts → azure-monitor.transport-D7Da4RAb.d.mts} +2 -2
  9. package/dist/{azure-monitor.transport-Cm74kXZS.d.mts.map → azure-monitor.transport-D7Da4RAb.d.mts.map} +1 -1
  10. package/dist/azure.d.mts +2 -2
  11. package/dist/azure.d.ts +2 -2
  12. package/dist/browser.d.mts +9 -0
  13. package/dist/browser.d.mts.map +1 -1
  14. package/dist/browser.d.ts +9 -0
  15. package/dist/browser.d.ts.map +1 -1
  16. package/dist/browser.js +43 -12
  17. package/dist/browser.js.map +1 -1
  18. package/dist/browser.mjs +43 -12
  19. package/dist/browser.mjs.map +1 -1
  20. package/dist/{logitron-logger.module-Bs3XYZgF.mjs → builder-0gEzRopq.mjs} +383 -1021
  21. package/dist/builder-0gEzRopq.mjs.map +1 -0
  22. package/dist/{logitron-logger.module-BsDZR5BH.js → builder-D44QktIo.js} +411 -1155
  23. package/dist/builder-D44QktIo.js.map +1 -0
  24. package/dist/cli/index.js +130 -65
  25. package/dist/cloudwatch.d.mts +2 -2
  26. package/dist/cloudwatch.d.ts +2 -2
  27. package/dist/cloudwatch.js +2 -1
  28. package/dist/cloudwatch.mjs +2 -1
  29. package/dist/{cloudwatch.transport-pNBNWJLt.js → cloudwatch.transport-BO1ahxw-.js} +26 -19
  30. package/dist/cloudwatch.transport-BO1ahxw-.js.map +1 -0
  31. package/dist/{cloudwatch.transport-yBwm4OeO.mjs → cloudwatch.transport-DZ6ies7g.mjs} +26 -19
  32. package/dist/cloudwatch.transport-DZ6ies7g.mjs.map +1 -0
  33. package/dist/{cloudwatch.transport-CGHY4buE.d.mts → cloudwatch.transport-DsEq633o.d.ts} +9 -2
  34. package/dist/cloudwatch.transport-DsEq633o.d.ts.map +1 -0
  35. package/dist/{cloudwatch.transport-DK_8cKd3.d.ts → cloudwatch.transport-UlyZFWMn.d.mts} +9 -2
  36. package/dist/cloudwatch.transport-UlyZFWMn.d.mts.map +1 -0
  37. package/dist/{coerce.utils-BN980Y9V.js → coerce.utils-B-LilukN.js} +1 -1
  38. package/dist/{coerce.utils-BN980Y9V.js.map → coerce.utils-B-LilukN.js.map} +1 -1
  39. package/dist/{coerce.utils-Dxv4_ikC.mjs → coerce.utils-Cu6IUTgX.mjs} +1 -1
  40. package/dist/{coerce.utils-Dxv4_ikC.mjs.map → coerce.utils-Cu6IUTgX.mjs.map} +1 -1
  41. package/dist/correlation.d.mts +24 -6
  42. package/dist/correlation.d.mts.map +1 -1
  43. package/dist/correlation.d.ts +24 -6
  44. package/dist/correlation.d.ts.map +1 -1
  45. package/dist/correlation.js +41 -16
  46. package/dist/correlation.js.map +1 -1
  47. package/dist/correlation.mjs +41 -16
  48. package/dist/correlation.mjs.map +1 -1
  49. package/dist/entry-fields-BJkuPnIg.mjs +30 -0
  50. package/dist/entry-fields-BJkuPnIg.mjs.map +1 -0
  51. package/dist/entry-fields-BvOLFlJ4.js +36 -0
  52. package/dist/entry-fields-BvOLFlJ4.js.map +1 -0
  53. package/dist/gcp.d.mts +2 -2
  54. package/dist/gcp.d.ts +2 -2
  55. package/dist/gcp.js +2 -1
  56. package/dist/gcp.mjs +2 -1
  57. package/dist/{gcp.transport-BOhkVKlI.d.ts → gcp.transport-B7oc97sG.d.ts} +2 -2
  58. package/dist/gcp.transport-B7oc97sG.d.ts.map +1 -0
  59. package/dist/{gcp.transport-SHdtc1n0.js → gcp.transport-CHV8MGgz.js} +5 -5
  60. package/dist/gcp.transport-CHV8MGgz.js.map +1 -0
  61. package/dist/{gcp.transport-BJuNRFe_.mjs → gcp.transport-DBX5TPIy.mjs} +5 -5
  62. package/dist/gcp.transport-DBX5TPIy.mjs.map +1 -0
  63. package/dist/{gcp.transport-Bi6CUqZR.d.mts → gcp.transport-GrJurKo8.d.mts} +2 -2
  64. package/dist/gcp.transport-GrJurKo8.d.mts.map +1 -0
  65. package/dist/{index-BPKwwERo.d.mts → index-3mw5gaCw.d.mts} +2 -2
  66. package/dist/{index-BPKwwERo.d.mts.map → index-3mw5gaCw.d.mts.map} +1 -1
  67. package/dist/{index-C1X-TE5I.d.ts → index-DhIoploR.d.ts} +2 -2
  68. package/dist/{index-C1X-TE5I.d.ts.map → index-DhIoploR.d.ts.map} +1 -1
  69. package/dist/index.d.mts +99 -137
  70. package/dist/index.d.mts.map +1 -1
  71. package/dist/index.d.ts +99 -137
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +146 -510
  74. package/dist/index.js.map +1 -1
  75. package/dist/index.mjs +99 -431
  76. package/dist/index.mjs.map +1 -1
  77. package/dist/logitron-logger-BFDSO8Io.d.mts +257 -0
  78. package/dist/logitron-logger-BFDSO8Io.d.mts.map +1 -0
  79. package/dist/logitron-logger-UVeN-mQm.d.ts +257 -0
  80. package/dist/logitron-logger-UVeN-mQm.d.ts.map +1 -0
  81. package/dist/middleware.d.mts +11 -4
  82. package/dist/middleware.d.mts.map +1 -1
  83. package/dist/middleware.d.ts +11 -4
  84. package/dist/middleware.d.ts.map +1 -1
  85. package/dist/middleware.js +148 -24
  86. package/dist/middleware.js.map +1 -1
  87. package/dist/middleware.mjs +148 -24
  88. package/dist/middleware.mjs.map +1 -1
  89. package/dist/nest.d.mts +481 -6
  90. package/dist/nest.d.mts.map +1 -1
  91. package/dist/nest.d.ts +481 -6
  92. package/dist/nest.d.ts.map +1 -1
  93. package/dist/nest.js +884 -13
  94. package/dist/nest.js.map +1 -0
  95. package/dist/nest.mjs +863 -6
  96. package/dist/nest.mjs.map +1 -0
  97. package/dist/{search-CFQRISUv.mjs → search-BFbu_oVn.mjs} +35 -12
  98. package/dist/search-BFbu_oVn.mjs.map +1 -0
  99. package/dist/{search-njTI2hdo.js → search-C4V0OMEn.js} +35 -12
  100. package/dist/search-C4V0OMEn.js.map +1 -0
  101. package/dist/{search-DujhR94O.d.ts → search-CNh9uVwR.d.ts} +2 -3
  102. package/dist/search-CNh9uVwR.d.ts.map +1 -0
  103. package/dist/{search-CQOo-Iq6.d.mts → search-DXANsQ2n.d.mts} +2 -3
  104. package/dist/search-DXANsQ2n.d.mts.map +1 -0
  105. package/dist/search.d.mts +3 -3
  106. package/dist/search.d.ts +3 -3
  107. package/dist/search.js +2 -2
  108. package/dist/search.mjs +2 -2
  109. package/dist/slack.transport-BZzoXDPn.d.mts +112 -0
  110. package/dist/slack.transport-BZzoXDPn.d.mts.map +1 -0
  111. package/dist/slack.transport-BfJRouB2.js +654 -0
  112. package/dist/slack.transport-BfJRouB2.js.map +1 -0
  113. package/dist/slack.transport-Bzw7sucI.mjs +643 -0
  114. package/dist/slack.transport-Bzw7sucI.mjs.map +1 -0
  115. package/dist/slack.transport-CXjQYOes.d.ts +112 -0
  116. package/dist/slack.transport-CXjQYOes.d.ts.map +1 -0
  117. package/dist/testing.d.mts +2 -2
  118. package/dist/testing.d.ts +2 -2
  119. package/dist/trace.utils-CvXgaiQT.mjs +278 -0
  120. package/dist/trace.utils-CvXgaiQT.mjs.map +1 -0
  121. package/dist/trace.utils-DpBOLDtq.js +358 -0
  122. package/dist/trace.utils-DpBOLDtq.js.map +1 -0
  123. package/dist/{transport.manager-D6KL3t9V.mjs → transport.manager-BiuCAJd2.mjs} +526 -160
  124. package/dist/transport.manager-BiuCAJd2.mjs.map +1 -0
  125. package/dist/{transport.manager-BivyUTtU.js → transport.manager-CXbKKdVE.js} +537 -159
  126. package/dist/transport.manager-CXbKKdVE.js.map +1 -0
  127. package/dist/{transport.types-B5vcyv2k.d.mts → transport.types-BMnurPcc.d.mts} +23 -3
  128. package/dist/transport.types-BMnurPcc.d.mts.map +1 -0
  129. package/dist/{transport.types-BuY84TwO.d.ts → transport.types-CGoHpWQR.d.ts} +23 -3
  130. package/dist/transport.types-CGoHpWQR.d.ts.map +1 -0
  131. package/dist/transports.d.mts +50 -20
  132. package/dist/transports.d.mts.map +1 -1
  133. package/dist/transports.d.ts +50 -20
  134. package/dist/transports.d.ts.map +1 -1
  135. package/dist/transports.js +9 -5
  136. package/dist/transports.mjs +8 -6
  137. package/dist/worker-entry.js +307 -55
  138. package/dist/worker.d.mts +2 -2
  139. package/dist/worker.d.ts +2 -2
  140. package/dist/worker.js +1 -1
  141. package/dist/worker.mjs +1 -1
  142. package/dist/{worker.transport-CfH6z37Z.js → worker.transport-BdPxu3PN.js} +1 -1
  143. package/dist/{worker.transport-CfH6z37Z.js.map → worker.transport-BdPxu3PN.js.map} +1 -1
  144. package/dist/{worker.transport-mKXgNK0L.d.ts → worker.transport-CdzSZJmw.d.ts} +2 -2
  145. package/dist/{worker.transport-mKXgNK0L.d.ts.map → worker.transport-CdzSZJmw.d.ts.map} +1 -1
  146. package/dist/{worker.transport-BP8Q28Z2.d.mts → worker.transport-JvGPog3C.d.mts} +2 -2
  147. package/dist/{worker.transport-BP8Q28Z2.d.mts.map → worker.transport-JvGPog3C.d.mts.map} +1 -1
  148. package/dist/{worker.transport-BhMyvqQ2.mjs → worker.transport-lPxO2MVL.mjs} +1 -1
  149. package/dist/{worker.transport-BhMyvqQ2.mjs.map → worker.transport-lPxO2MVL.mjs.map} +1 -1
  150. package/package.json +27 -14
  151. package/dist/.tsbuildinfo +0 -1
  152. package/dist/async-context-CSHWoHMB.js.map +0 -1
  153. package/dist/async-context-CwBNMm2E.mjs.map +0 -1
  154. package/dist/cloudwatch.transport-CGHY4buE.d.mts.map +0 -1
  155. package/dist/cloudwatch.transport-DK_8cKd3.d.ts.map +0 -1
  156. package/dist/cloudwatch.transport-pNBNWJLt.js.map +0 -1
  157. package/dist/cloudwatch.transport-yBwm4OeO.mjs.map +0 -1
  158. package/dist/gcp.transport-BJuNRFe_.mjs.map +0 -1
  159. package/dist/gcp.transport-BOhkVKlI.d.ts.map +0 -1
  160. package/dist/gcp.transport-Bi6CUqZR.d.mts.map +0 -1
  161. package/dist/gcp.transport-SHdtc1n0.js.map +0 -1
  162. package/dist/logitron-logger.module-BdG1Jnpk.d.mts +0 -618
  163. package/dist/logitron-logger.module-BdG1Jnpk.d.mts.map +0 -1
  164. package/dist/logitron-logger.module-Bs3XYZgF.mjs.map +0 -1
  165. package/dist/logitron-logger.module-BsDZR5BH.js.map +0 -1
  166. package/dist/logitron-logger.module-CbXy2gfW.d.ts +0 -618
  167. package/dist/logitron-logger.module-CbXy2gfW.d.ts.map +0 -1
  168. package/dist/search-CFQRISUv.mjs.map +0 -1
  169. package/dist/search-CQOo-Iq6.d.mts.map +0 -1
  170. package/dist/search-DujhR94O.d.ts.map +0 -1
  171. package/dist/search-njTI2hdo.js.map +0 -1
  172. package/dist/transport.manager-BivyUTtU.js.map +0 -1
  173. package/dist/transport.manager-D6KL3t9V.mjs.map +0 -1
  174. package/dist/transport.types-B5vcyv2k.d.mts.map +0 -1
  175. package/dist/transport.types-BuY84TwO.d.ts.map +0 -1
  176. package/scripts/postinstall.js +0 -61
@@ -0,0 +1,257 @@
1
+ import { b as LoggerWithLevels, f as ILogger, h as LogEntry, p as ILoggerDefault, v as LogLevelString, x as NamespaceLevels, y as LoggerConfig } from "./index-3mw5gaCw.mjs";
2
+
3
+ //#region src/plugin.d.ts
4
+
5
+ interface LogixiaPlugin {
6
+ /**
7
+ * Unique plugin name.
8
+ * logixia uses this to prevent duplicate registration of the same plugin
9
+ * on the same logger instance.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Called once immediately after `logger.use(plugin)` is called.
14
+ * Use for one-time setup (open connections, allocate buffers, etc.).
15
+ * Async `onInit` errors are silently swallowed to avoid blocking the logger.
16
+ */
17
+ onInit?(): void | Promise<void>;
18
+ /**
19
+ * Called for every log entry **after** PII redaction and **before** transport
20
+ * dispatch. Plugins run in registration order; each receives the (possibly
21
+ * modified) output of the previous plugin.
22
+ *
23
+ * - Return the entry (modified or unchanged) to continue processing.
24
+ * - Return `null` to **drop** the entry — no transport will receive it.
25
+ *
26
+ * Errors thrown inside `onLog` are swallowed so a buggy plugin cannot crash
27
+ * logging; the chain continues with the previous (un-transformed) entry.
28
+ */
29
+ onLog?(entry: LogEntry): LogEntry | null | Promise<LogEntry | null>;
30
+ /**
31
+ * Called when a transport write fails (after any configured retries).
32
+ * Useful for routing transport errors to an alerting or metrics system.
33
+ * Errors thrown inside `onError` are silently swallowed.
34
+ */
35
+ onError?(error: Error, entry?: LogEntry): void | Promise<void>;
36
+ /**
37
+ * Called when the logger is closed via `logger.close()` or the process
38
+ * receives a shutdown signal (when `gracefulShutdown` is enabled).
39
+ * Errors thrown inside `onShutdown` are silently swallowed.
40
+ */
41
+ onShutdown?(): void | Promise<void>;
42
+ }
43
+ /**
44
+ * Holds an ordered list of `LogixiaPlugin` instances and dispatches lifecycle
45
+ * events to them. One registry is created per logger instance; a global
46
+ * singleton is also exported for process-wide registration.
47
+ */
48
+ declare class PluginRegistry {
49
+ private readonly _plugins;
50
+ /**
51
+ * Register a plugin. Silently skips if a plugin with the same `name` is
52
+ * already registered on this registry.
53
+ */
54
+ register(plugin: LogixiaPlugin): void;
55
+ /** Remove a previously registered plugin by name. No-op if not found. */
56
+ unregister(name: string): void;
57
+ /** Returns `true` if a plugin with the given name is registered. */
58
+ has(name: string): boolean;
59
+ /** Number of currently registered plugins. */
60
+ get size(): number;
61
+ /**
62
+ * Run all `onLog` hooks in order.
63
+ * Returns `null` if any plugin cancels the entry; otherwise returns the
64
+ * (possibly transformed) entry.
65
+ */
66
+ runOnLog(entry: LogEntry): Promise<LogEntry | null>;
67
+ /**
68
+ * Notify all `onError` hooks.
69
+ * Errors thrown inside hooks are swallowed to prevent error cascades.
70
+ */
71
+ runOnError(error: Error, entry?: LogEntry): Promise<void>;
72
+ /** Run all `onShutdown` hooks concurrently. Hook errors are swallowed. */
73
+ runOnShutdown(): Promise<void>;
74
+ }
75
+ /**
76
+ * Module-level singleton registry.
77
+ *
78
+ * Plugins registered here are automatically copied into every **new** logger
79
+ * instance created after the registration. Already-created loggers are not
80
+ * retroactively affected — use `logger.use(plugin)` for per-instance control.
81
+ */
82
+ declare const globalPluginRegistry: PluginRegistry;
83
+ /**
84
+ * Register a plugin in the global registry so it applies to every future
85
+ * logger instance.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * import { usePlugin } from 'logixia';
90
+ *
91
+ * usePlugin({
92
+ * name: 'audit-sink',
93
+ * onLog(entry) {
94
+ * if (entry.level === 'error') auditQueue.push(entry);
95
+ * return entry;
96
+ * },
97
+ * });
98
+ * ```
99
+ */
100
+ declare function usePlugin(plugin: LogixiaPlugin): void;
101
+ //#endregion
102
+ //#region src/core/logitron-logger.d.ts
103
+ declare class LogixiaLogger<TConfig extends LoggerConfig<Record<string, number>> = LoggerConfig> implements ILoggerDefault {
104
+ [K: string]: any;
105
+ private config;
106
+ private context?;
107
+ private timers;
108
+ private contextData;
109
+ private transportManager;
110
+ private fieldState;
111
+ /** Stable fallback trace ID generated ONCE per logger instance. */
112
+ private readonly fallbackTraceId;
113
+ /** Numeric value for each known log level — built once, read on every log call. */
114
+ private _levelValues;
115
+ /** Numeric threshold for the currently active log level. */
116
+ private _minLevelValue;
117
+ /** `source=value` pairs already reported as unknown levels — warn once per logger. */
118
+ private readonly _warnedInvalidLevels;
119
+ /** Pre-built ANSI color codes to avoid recreating the object in colorize(). */
120
+ private _colorMap;
121
+ /** Pre-computed field-enabled booleans so isFieldEnabled() isn't called per log. */
122
+ private _fieldCache;
123
+ /** True when contextData is non-empty — avoids Object.keys() check on hot path. */
124
+ private _hasContextData;
125
+ /**
126
+ * Pre-computed `[INFO] `, `[WARN] ` etc. strings — avoids a colorize() call per log.
127
+ * Key: lowercase level name. Value: formatted bracket string ready to concatenate.
128
+ */
129
+ private _formattedLevels;
130
+ /** Pre-computed `[appName] ` string — avoids template literal allocation per log. */
131
+ private _formattedAppName;
132
+ /** True when a redact config is present — short-circuits applyRedaction when false. */
133
+ private _hasRedact;
134
+ /** Sampling engine — only created when sampling config is present. */
135
+ private _sampler;
136
+ /** Per-instance plugin registry — also inherits from the global registry at creation time. */
137
+ private readonly _pluginRegistry;
138
+ /** Set on loggers created by child(); they borrow the root's transports, sampler and plugins. */
139
+ private readonly _parent;
140
+ constructor(config: TConfig, context?: string, parent?: LogixiaLogger<TConfig>);
141
+ private setupGracefulShutdown;
142
+ private createCustomLevelMethods;
143
+ /**
144
+ * Rebuild all hot-path caches after any config mutation or level change.
145
+ * Keeps the actual log() call free of allocations in the common case.
146
+ */
147
+ private _buildPerfCaches;
148
+ error(messageOrError: string | Error, data?: Record<string, unknown>): Promise<void>;
149
+ warn(message: string, data?: Record<string, unknown>): Promise<void>;
150
+ info(message: string, data?: Record<string, unknown>): Promise<void>;
151
+ debug(message: string, data?: Record<string, unknown>): Promise<void>;
152
+ trace(message: string, data?: Record<string, unknown>): Promise<void>;
153
+ verbose(message: string, data?: Record<string, unknown>): Promise<void>;
154
+ logLevel(level: string, message: string, data?: Record<string, unknown>): Promise<void>;
155
+ time(label: string): void;
156
+ timeEnd(label: string): Promise<number | undefined>;
157
+ timeAsync<T>(label: string, fn: () => Promise<T>): Promise<T>;
158
+ setLevel(level: LogLevelString): void;
159
+ getLevel(): LogLevelString;
160
+ private _validLevelList;
161
+ /**
162
+ * Canonicalise a level from config/ENV. Unknown values return undefined so the
163
+ * caller falls through to the next source, and warn once per logger per source.
164
+ */
165
+ private _validLevel;
166
+ /**
167
+ * Replace the per-namespace level map at runtime — no restart needed.
168
+ *
169
+ * This is the runtime counterpart to the `namespaceLevels` config option and
170
+ * the most-requested logging feature across the Winston/Pino issue trackers
171
+ * (flip a module's verbosity live to chase a bug without raising global
172
+ * volume). The new map fully replaces the previous one.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * // Turn on debug for the DB layer only, live:
177
+ * logger.setNamespaceLevels({ 'db.*': 'debug', '*': 'info' });
178
+ * ```
179
+ */
180
+ setNamespaceLevels(levels: NamespaceLevels): void;
181
+ /** Merge entries into the existing per-namespace level map at runtime. */
182
+ patchNamespaceLevels(levels: NamespaceLevels): void;
183
+ /** Return a copy of the current per-namespace level map. */
184
+ getNamespaceLevels(): NamespaceLevels;
185
+ setContext(context: string): void;
186
+ getContext(): string | undefined;
187
+ enableField(fieldName: string): void;
188
+ disableField(fieldName: string): void;
189
+ isFieldEnabled(fieldName: string): boolean;
190
+ getFieldState(): Record<string, boolean>;
191
+ resetFieldState(): void;
192
+ /** @deprecated No-op. Library code never prompts on stdin; use setTransportLevels(). */
193
+ enableTransportLevelPrompting(): void;
194
+ /** @deprecated No-op. */
195
+ disableTransportLevelPrompting(): void;
196
+ setTransportLevels(transportId: string, levels: string[]): void;
197
+ getTransportLevels(transportId: string): string[] | undefined;
198
+ clearTransportLevelPreferences(): void;
199
+ getAvailableTransports(): string[];
200
+ child(context: string, data?: Record<string, unknown>): ILogger;
201
+ /**
202
+ * Register a plugin on this logger instance.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * logger.use({
207
+ * name: 'audit',
208
+ * onLog(entry) { auditQueue.push(entry); return entry; },
209
+ * });
210
+ * ```
211
+ */
212
+ use(plugin: LogixiaPlugin): this;
213
+ /**
214
+ * Remove a previously registered plugin by name.
215
+ * No-op if the plugin is not registered on this instance.
216
+ */
217
+ unuse(pluginName: string): this;
218
+ flush(): Promise<void>;
219
+ healthCheck(): Promise<{
220
+ healthy: boolean;
221
+ details: Record<string, unknown>;
222
+ }>;
223
+ close(): Promise<void>;
224
+ private log;
225
+ /**
226
+ * Hot-path level check: a single Map lookup + integer compare.
227
+ * The level map and threshold are pre-built in _buildPerfCaches().
228
+ */
229
+ private shouldLog;
230
+ /**
231
+ * Feature 3: Resolve the effective log level for this logger instance.
232
+ *
233
+ * Priority:
234
+ * 1. ENV `LOGIXIA_LEVEL_<NS_UPPER>` (e.g. LOGIXIA_LEVEL_DB for ns "db" or "db.queries")
235
+ * 2. Matching `namespaceLevels` config entry (longer pattern = more specific, wins)
236
+ * 3. Global `LOGIXIA_LEVEL` ENV override
237
+ * 4. `levelOptions.level` (resolved via Feature 5 in constructor)
238
+ */
239
+ private resolveEffectiveLevel;
240
+ private formatLog;
241
+ private colorize;
242
+ /**
243
+ * Dispatch the entry to transports (each formats itself). Returns `void` when
244
+ * the write completes synchronously (console-only hot path) and a Promise only
245
+ * when a transport is genuinely async — so the caller awaits only when needed.
246
+ * Formatting for the no-transport fallback is done lazily, never on the
247
+ * transport path.
248
+ */
249
+ private output;
250
+ /** Shared transport-failure handler: log internally, notify plugins, then fall
251
+ * back to a direct stdout/stderr write so the entry is never lost. */
252
+ private _handleOutputError;
253
+ }
254
+ declare function createLogger<T extends LoggerConfig<Record<string, number>>>(config: T, context?: string): LoggerWithLevels<T>;
255
+ //#endregion
256
+ export { globalPluginRegistry as a, PluginRegistry as i, createLogger as n, usePlugin as o, LogixiaPlugin as r, LogixiaLogger as t };
257
+ //# sourceMappingURL=logitron-logger-BFDSO8Io.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logitron-logger-BFDSO8Io.d.mts","names":[],"sources":["../src/plugin.ts","../src/core/logitron-logger.ts"],"sourcesContent":[],"mappings":";;;;AC2K+B,UDzId,aAAA,CCyIc;EAAb;;;;;EA4SqB,IAAA,EAAA,MAAA;EAAc;;;;;EAeU,MAAA,GAAA,EAAA,IAAA,GDvb3C,OCub2C,CAAA,IAAA,CAAA;EAIzB;;;;;;;;;;;EAyC6B,KAAA,EAAA,KAAA,EDvdnD,QCudmD,CAAA,EDvdxC,QCudwC,GAAA,IAAA,GDvdtB,OC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ohBJ,CAAA,MAAA,GAAA,SAAA,CAAA;EAAwB,SAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,MAAA,EAAA,EAAA,EAAA,GAAA,GAjgBN,OAigBM,CAjgBE,CAigBF,CAAA,CAAA,EAjgBO,OAigBP,CAjgBe,CAigBf,CAAA;EAAb,QAAA,CAAA,KAAA,EAnfrB,cAmfqB,CAAA,EAAA,IAAA;EAC7B,QAAA,CAAA,CAAA,EAleI,cAkeJ;EAEU,QAAA,eAAA;EAAjB;;;;;;;;;;;;;;;;;;;6BA1b0B;;+BAQE;;wBAMP;;;;;;mBAsCL;;;;;;;;;;gCA2Da,0BAA0B;;;;;;;;;;;;cA0B5C;;;;;;WAgBG;iBAIM;;aAAqC;;WAO3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmRD,uBAAuB,aAAa,iCAC1C,sBAEP,iBAAiB"}
@@ -0,0 +1,257 @@
1
+ import { b as LoggerWithLevels, f as ILogger, h as LogEntry, p as ILoggerDefault, v as LogLevelString, x as NamespaceLevels, y as LoggerConfig } from "./index-DhIoploR.js";
2
+
3
+ //#region src/plugin.d.ts
4
+
5
+ interface LogixiaPlugin {
6
+ /**
7
+ * Unique plugin name.
8
+ * logixia uses this to prevent duplicate registration of the same plugin
9
+ * on the same logger instance.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Called once immediately after `logger.use(plugin)` is called.
14
+ * Use for one-time setup (open connections, allocate buffers, etc.).
15
+ * Async `onInit` errors are silently swallowed to avoid blocking the logger.
16
+ */
17
+ onInit?(): void | Promise<void>;
18
+ /**
19
+ * Called for every log entry **after** PII redaction and **before** transport
20
+ * dispatch. Plugins run in registration order; each receives the (possibly
21
+ * modified) output of the previous plugin.
22
+ *
23
+ * - Return the entry (modified or unchanged) to continue processing.
24
+ * - Return `null` to **drop** the entry — no transport will receive it.
25
+ *
26
+ * Errors thrown inside `onLog` are swallowed so a buggy plugin cannot crash
27
+ * logging; the chain continues with the previous (un-transformed) entry.
28
+ */
29
+ onLog?(entry: LogEntry): LogEntry | null | Promise<LogEntry | null>;
30
+ /**
31
+ * Called when a transport write fails (after any configured retries).
32
+ * Useful for routing transport errors to an alerting or metrics system.
33
+ * Errors thrown inside `onError` are silently swallowed.
34
+ */
35
+ onError?(error: Error, entry?: LogEntry): void | Promise<void>;
36
+ /**
37
+ * Called when the logger is closed via `logger.close()` or the process
38
+ * receives a shutdown signal (when `gracefulShutdown` is enabled).
39
+ * Errors thrown inside `onShutdown` are silently swallowed.
40
+ */
41
+ onShutdown?(): void | Promise<void>;
42
+ }
43
+ /**
44
+ * Holds an ordered list of `LogixiaPlugin` instances and dispatches lifecycle
45
+ * events to them. One registry is created per logger instance; a global
46
+ * singleton is also exported for process-wide registration.
47
+ */
48
+ declare class PluginRegistry {
49
+ private readonly _plugins;
50
+ /**
51
+ * Register a plugin. Silently skips if a plugin with the same `name` is
52
+ * already registered on this registry.
53
+ */
54
+ register(plugin: LogixiaPlugin): void;
55
+ /** Remove a previously registered plugin by name. No-op if not found. */
56
+ unregister(name: string): void;
57
+ /** Returns `true` if a plugin with the given name is registered. */
58
+ has(name: string): boolean;
59
+ /** Number of currently registered plugins. */
60
+ get size(): number;
61
+ /**
62
+ * Run all `onLog` hooks in order.
63
+ * Returns `null` if any plugin cancels the entry; otherwise returns the
64
+ * (possibly transformed) entry.
65
+ */
66
+ runOnLog(entry: LogEntry): Promise<LogEntry | null>;
67
+ /**
68
+ * Notify all `onError` hooks.
69
+ * Errors thrown inside hooks are swallowed to prevent error cascades.
70
+ */
71
+ runOnError(error: Error, entry?: LogEntry): Promise<void>;
72
+ /** Run all `onShutdown` hooks concurrently. Hook errors are swallowed. */
73
+ runOnShutdown(): Promise<void>;
74
+ }
75
+ /**
76
+ * Module-level singleton registry.
77
+ *
78
+ * Plugins registered here are automatically copied into every **new** logger
79
+ * instance created after the registration. Already-created loggers are not
80
+ * retroactively affected — use `logger.use(plugin)` for per-instance control.
81
+ */
82
+ declare const globalPluginRegistry: PluginRegistry;
83
+ /**
84
+ * Register a plugin in the global registry so it applies to every future
85
+ * logger instance.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * import { usePlugin } from 'logixia';
90
+ *
91
+ * usePlugin({
92
+ * name: 'audit-sink',
93
+ * onLog(entry) {
94
+ * if (entry.level === 'error') auditQueue.push(entry);
95
+ * return entry;
96
+ * },
97
+ * });
98
+ * ```
99
+ */
100
+ declare function usePlugin(plugin: LogixiaPlugin): void;
101
+ //#endregion
102
+ //#region src/core/logitron-logger.d.ts
103
+ declare class LogixiaLogger<TConfig extends LoggerConfig<Record<string, number>> = LoggerConfig> implements ILoggerDefault {
104
+ [K: string]: any;
105
+ private config;
106
+ private context?;
107
+ private timers;
108
+ private contextData;
109
+ private transportManager;
110
+ private fieldState;
111
+ /** Stable fallback trace ID generated ONCE per logger instance. */
112
+ private readonly fallbackTraceId;
113
+ /** Numeric value for each known log level — built once, read on every log call. */
114
+ private _levelValues;
115
+ /** Numeric threshold for the currently active log level. */
116
+ private _minLevelValue;
117
+ /** `source=value` pairs already reported as unknown levels — warn once per logger. */
118
+ private readonly _warnedInvalidLevels;
119
+ /** Pre-built ANSI color codes to avoid recreating the object in colorize(). */
120
+ private _colorMap;
121
+ /** Pre-computed field-enabled booleans so isFieldEnabled() isn't called per log. */
122
+ private _fieldCache;
123
+ /** True when contextData is non-empty — avoids Object.keys() check on hot path. */
124
+ private _hasContextData;
125
+ /**
126
+ * Pre-computed `[INFO] `, `[WARN] ` etc. strings — avoids a colorize() call per log.
127
+ * Key: lowercase level name. Value: formatted bracket string ready to concatenate.
128
+ */
129
+ private _formattedLevels;
130
+ /** Pre-computed `[appName] ` string — avoids template literal allocation per log. */
131
+ private _formattedAppName;
132
+ /** True when a redact config is present — short-circuits applyRedaction when false. */
133
+ private _hasRedact;
134
+ /** Sampling engine — only created when sampling config is present. */
135
+ private _sampler;
136
+ /** Per-instance plugin registry — also inherits from the global registry at creation time. */
137
+ private readonly _pluginRegistry;
138
+ /** Set on loggers created by child(); they borrow the root's transports, sampler and plugins. */
139
+ private readonly _parent;
140
+ constructor(config: TConfig, context?: string, parent?: LogixiaLogger<TConfig>);
141
+ private setupGracefulShutdown;
142
+ private createCustomLevelMethods;
143
+ /**
144
+ * Rebuild all hot-path caches after any config mutation or level change.
145
+ * Keeps the actual log() call free of allocations in the common case.
146
+ */
147
+ private _buildPerfCaches;
148
+ error(messageOrError: string | Error, data?: Record<string, unknown>): Promise<void>;
149
+ warn(message: string, data?: Record<string, unknown>): Promise<void>;
150
+ info(message: string, data?: Record<string, unknown>): Promise<void>;
151
+ debug(message: string, data?: Record<string, unknown>): Promise<void>;
152
+ trace(message: string, data?: Record<string, unknown>): Promise<void>;
153
+ verbose(message: string, data?: Record<string, unknown>): Promise<void>;
154
+ logLevel(level: string, message: string, data?: Record<string, unknown>): Promise<void>;
155
+ time(label: string): void;
156
+ timeEnd(label: string): Promise<number | undefined>;
157
+ timeAsync<T>(label: string, fn: () => Promise<T>): Promise<T>;
158
+ setLevel(level: LogLevelString): void;
159
+ getLevel(): LogLevelString;
160
+ private _validLevelList;
161
+ /**
162
+ * Canonicalise a level from config/ENV. Unknown values return undefined so the
163
+ * caller falls through to the next source, and warn once per logger per source.
164
+ */
165
+ private _validLevel;
166
+ /**
167
+ * Replace the per-namespace level map at runtime — no restart needed.
168
+ *
169
+ * This is the runtime counterpart to the `namespaceLevels` config option and
170
+ * the most-requested logging feature across the Winston/Pino issue trackers
171
+ * (flip a module's verbosity live to chase a bug without raising global
172
+ * volume). The new map fully replaces the previous one.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * // Turn on debug for the DB layer only, live:
177
+ * logger.setNamespaceLevels({ 'db.*': 'debug', '*': 'info' });
178
+ * ```
179
+ */
180
+ setNamespaceLevels(levels: NamespaceLevels): void;
181
+ /** Merge entries into the existing per-namespace level map at runtime. */
182
+ patchNamespaceLevels(levels: NamespaceLevels): void;
183
+ /** Return a copy of the current per-namespace level map. */
184
+ getNamespaceLevels(): NamespaceLevels;
185
+ setContext(context: string): void;
186
+ getContext(): string | undefined;
187
+ enableField(fieldName: string): void;
188
+ disableField(fieldName: string): void;
189
+ isFieldEnabled(fieldName: string): boolean;
190
+ getFieldState(): Record<string, boolean>;
191
+ resetFieldState(): void;
192
+ /** @deprecated No-op. Library code never prompts on stdin; use setTransportLevels(). */
193
+ enableTransportLevelPrompting(): void;
194
+ /** @deprecated No-op. */
195
+ disableTransportLevelPrompting(): void;
196
+ setTransportLevels(transportId: string, levels: string[]): void;
197
+ getTransportLevels(transportId: string): string[] | undefined;
198
+ clearTransportLevelPreferences(): void;
199
+ getAvailableTransports(): string[];
200
+ child(context: string, data?: Record<string, unknown>): ILogger;
201
+ /**
202
+ * Register a plugin on this logger instance.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * logger.use({
207
+ * name: 'audit',
208
+ * onLog(entry) { auditQueue.push(entry); return entry; },
209
+ * });
210
+ * ```
211
+ */
212
+ use(plugin: LogixiaPlugin): this;
213
+ /**
214
+ * Remove a previously registered plugin by name.
215
+ * No-op if the plugin is not registered on this instance.
216
+ */
217
+ unuse(pluginName: string): this;
218
+ flush(): Promise<void>;
219
+ healthCheck(): Promise<{
220
+ healthy: boolean;
221
+ details: Record<string, unknown>;
222
+ }>;
223
+ close(): Promise<void>;
224
+ private log;
225
+ /**
226
+ * Hot-path level check: a single Map lookup + integer compare.
227
+ * The level map and threshold are pre-built in _buildPerfCaches().
228
+ */
229
+ private shouldLog;
230
+ /**
231
+ * Feature 3: Resolve the effective log level for this logger instance.
232
+ *
233
+ * Priority:
234
+ * 1. ENV `LOGIXIA_LEVEL_<NS_UPPER>` (e.g. LOGIXIA_LEVEL_DB for ns "db" or "db.queries")
235
+ * 2. Matching `namespaceLevels` config entry (longer pattern = more specific, wins)
236
+ * 3. Global `LOGIXIA_LEVEL` ENV override
237
+ * 4. `levelOptions.level` (resolved via Feature 5 in constructor)
238
+ */
239
+ private resolveEffectiveLevel;
240
+ private formatLog;
241
+ private colorize;
242
+ /**
243
+ * Dispatch the entry to transports (each formats itself). Returns `void` when
244
+ * the write completes synchronously (console-only hot path) and a Promise only
245
+ * when a transport is genuinely async — so the caller awaits only when needed.
246
+ * Formatting for the no-transport fallback is done lazily, never on the
247
+ * transport path.
248
+ */
249
+ private output;
250
+ /** Shared transport-failure handler: log internally, notify plugins, then fall
251
+ * back to a direct stdout/stderr write so the entry is never lost. */
252
+ private _handleOutputError;
253
+ }
254
+ declare function createLogger<T extends LoggerConfig<Record<string, number>>>(config: T, context?: string): LoggerWithLevels<T>;
255
+ //#endregion
256
+ export { globalPluginRegistry as a, PluginRegistry as i, createLogger as n, usePlugin as o, LogixiaPlugin as r, LogixiaLogger as t };
257
+ //# sourceMappingURL=logitron-logger-UVeN-mQm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logitron-logger-UVeN-mQm.d.ts","names":[],"sources":["../src/plugin.ts","../src/core/logitron-logger.ts"],"sourcesContent":[],"mappings":";;;;AC2K+B,UDzId,aAAA,CCyIc;EAAb;;;;;EA4SqB,IAAA,EAAA,MAAA;EAAc;;;;;EAeU,MAAA,GAAA,EAAA,IAAA,GDvb3C,OCub2C,CAAA,IAAA,CAAA;EAIzB;;;;;;;;;;;EAyC6B,KAAA,EAAA,KAAA,EDvdnD,QCudmD,CAAA,EDvdxC,QCudwC,GAAA,IAAA,GDvdtB,OCudsB,CDvdd,QCudc,GAAA,IAAA,CAAA;EAAR;;;;;EAwFnC,OAAA,EAAA,KAAA,EDxiBN,KCwiBM,EAAA,KAAA,CAAA,EDxiBS,QCwiBT,CAAA,EAAA,IAAA,GDxiB2B,OCwiB3B,CAAA,IAAA,CAAA;EAsCL;;;;;EAyGyC,UAAA,GAAA,EAAA,IAAA,GDhrBpC,OCgrBoC,CAAA,IAAA,CAAA;;;;;AA0R5D;;AAAuC,cDh8B1B,cAAA,CCg8B0B;EAC7B,iBAAA,QAAA;EAEU;;;;mBD57BD;;;;;;;;;;;;kBAqCK,WAAW,QAAQ;;;;;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;;;;;gCA2Da,0BAA0B;;;;;;;;;;;;cA0B5C;;;;;;WAgBG;iBAIM;;aAAqC;;WAO3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmRD,uBAAuB,aAAa,iCAC1C,sBAEP,iBAAiB"}
@@ -1,5 +1,5 @@
1
- import "./transport.types-B5vcyv2k.mjs";
2
- import { u as IBaseLogger } from "./index-BPKwwERo.mjs";
1
+ import "./transport.types-BMnurPcc.mjs";
2
+ import { u as IBaseLogger } from "./index-3mw5gaCw.mjs";
3
3
 
4
4
  //#region src/middleware/http-logger.d.ts
5
5
 
@@ -33,10 +33,17 @@ interface HttpLoggerOptions {
33
33
  */
34
34
  traceIdHeader?: string;
35
35
  /**
36
- * Headers to redact from logged output.
37
- * Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key'].
36
+ * Additional headers to redact from logged output. Merged with the defaults
37
+ * (authorization, cookie, set-cookie, x-api-key, proxy-authorization,
38
+ * x-auth-token, x-access-token, x-csrf-token, x-amz-security-token).
38
39
  */
39
40
  redactHeaders?: string[];
41
+ /**
42
+ * Additional query-string parameter names whose values are redacted from the
43
+ * logged URL. Merged with the defaults (token, access_token, refresh_token,
44
+ * code, password, secret, api_key, apikey, key, signature, sig, auth).
45
+ */
46
+ redactQueryParams?: string[];
40
47
  /**
41
48
  * Log level for request-start entries. Default: 'debug'.
42
49
  * Set to 'silent' to suppress request-start logs entirely.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.mts","names":[],"sources":["../src/middleware/http-logger.ts"],"sourcesContent":[],"mappings":";;;;;UA6BiB,iBAAA;;;;;eAKF;;;;;;;;;;;;;;;;;;sBAkBO,oBAAoB;;;;;;;;;;;;;;;;;;;;;UAuBzB,eAAA;;;YAGL;;;;;;;UAMK,gBAAA;;;;;;;;;iBA0DD,uBAAA,SACN,uBACC,0BACF,sBAAsB;UA6Ed,eAAA;;;;;;;;;;;iBAYD,mBAAA,SAA4B,uBAAsB,+BAUzB"}
1
+ {"version":3,"file":"middleware.d.mts","names":[],"sources":["../src/middleware/http-logger.ts"],"sourcesContent":[],"mappings":";;;;;UA+BiB,iBAAA;;;;;eAKF;;;;;;;;;;;;;;;;;;sBAkBO,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BzB,eAAA;;;YAGL;;;;;;;UAMK,gBAAA;;;;;;;;;iBAsID,uBAAA,SACN,uBACC,0BACF,sBAAsB;UAqFd,eAAA;;;;;;;;;;;iBAYD,mBAAA,SAA4B,uBAAsB,+BAYzB"}
@@ -1,5 +1,5 @@
1
- import "./transport.types-BuY84TwO.js";
2
- import { u as IBaseLogger } from "./index-C1X-TE5I.js";
1
+ import "./transport.types-CGoHpWQR.js";
2
+ import { u as IBaseLogger } from "./index-DhIoploR.js";
3
3
 
4
4
  //#region src/middleware/http-logger.d.ts
5
5
 
@@ -33,10 +33,17 @@ interface HttpLoggerOptions {
33
33
  */
34
34
  traceIdHeader?: string;
35
35
  /**
36
- * Headers to redact from logged output.
37
- * Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key'].
36
+ * Additional headers to redact from logged output. Merged with the defaults
37
+ * (authorization, cookie, set-cookie, x-api-key, proxy-authorization,
38
+ * x-auth-token, x-access-token, x-csrf-token, x-amz-security-token).
38
39
  */
39
40
  redactHeaders?: string[];
41
+ /**
42
+ * Additional query-string parameter names whose values are redacted from the
43
+ * logged URL. Merged with the defaults (token, access_token, refresh_token,
44
+ * code, password, secret, api_key, apikey, key, signature, sig, auth).
45
+ */
46
+ redactQueryParams?: string[];
40
47
  /**
41
48
  * Log level for request-start entries. Default: 'debug'.
42
49
  * Set to 'silent' to suppress request-start logs entirely.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","names":[],"sources":["../src/middleware/http-logger.ts"],"sourcesContent":[],"mappings":";;;;;UA6BiB,iBAAA;;;;;eAKF;;;;;;;;;;;;;;;;;;sBAkBO,oBAAoB;;;;;;;;;;;;;;;;;;;;;UAuBzB,eAAA;;;YAGL;;;;;;;UAMK,gBAAA;;;;;;;;;iBA0DD,uBAAA,SACN,uBACC,0BACF,sBAAsB;UA6Ed,eAAA;;;;;;;;;;;iBAYD,mBAAA,SAA4B,uBAAsB,+BAUzB"}
1
+ {"version":3,"file":"middleware.d.ts","names":[],"sources":["../src/middleware/http-logger.ts"],"sourcesContent":[],"mappings":";;;;;UA+BiB,iBAAA;;;;;eAKF;;;;;;;;;;;;;;;;;;sBAkBO,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BzB,eAAA;;;YAGL;;;;;;;UAMK,gBAAA;;;;;;;;;iBAsID,uBAAA,SACN,uBACC,0BACF,sBAAsB;UAqFd,eAAA;;;;;;;;;;;iBAYD,mBAAA,SAA4B,uBAAsB,+BAYzB"}