logixia 2.1.0 → 2.3.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 (163) hide show
  1. package/README.md +2 -2
  2. package/dist/{async-context-Dgl3ZLyb.js → async-context-BqjwNzgS.js} +2 -2
  3. package/dist/{async-context-Dgl3ZLyb.js.map → async-context-BqjwNzgS.js.map} +1 -1
  4. package/dist/{async-context-fBqC5lNc.mjs → async-context-DJdxbbCU.mjs} +2 -2
  5. package/dist/{async-context-fBqC5lNc.mjs.map → async-context-DJdxbbCU.mjs.map} +1 -1
  6. package/dist/{azure-monitor.transport-C5VjvREZ.d.mts → azure-monitor.transport-BZDaQjy8.d.mts} +2 -2
  7. package/dist/{azure-monitor.transport-C5VjvREZ.d.mts.map → azure-monitor.transport-BZDaQjy8.d.mts.map} +1 -1
  8. package/dist/{azure-monitor.transport-DGiacfvT.mjs → azure-monitor.transport-B_dqSV_o.mjs} +3 -3
  9. package/dist/{azure-monitor.transport-DGiacfvT.mjs.map → azure-monitor.transport-B_dqSV_o.mjs.map} +1 -1
  10. package/dist/{azure-monitor.transport-DX3fuK2t.js → azure-monitor.transport-Bl3xVvpN.js} +3 -3
  11. package/dist/{azure-monitor.transport-DX3fuK2t.js.map → azure-monitor.transport-Bl3xVvpN.js.map} +1 -1
  12. package/dist/{azure-monitor.transport-CyHDjHS-.d.ts → azure-monitor.transport-MDigkKsS.d.ts} +2 -2
  13. package/dist/{azure-monitor.transport-CyHDjHS-.d.ts.map → azure-monitor.transport-MDigkKsS.d.ts.map} +1 -1
  14. package/dist/azure.d.mts +1 -1
  15. package/dist/azure.d.ts +1 -1
  16. package/dist/azure.js +1 -1
  17. package/dist/azure.mjs +1 -1
  18. package/dist/{batch-buffer-CM-lK_Qy.mjs → batch-buffer-BnmVCCwI.mjs} +2 -2
  19. package/dist/{batch-buffer-CM-lK_Qy.mjs.map → batch-buffer-BnmVCCwI.mjs.map} +1 -1
  20. package/dist/{batch-buffer-BLmVvJAZ.js → batch-buffer-C-ETEX3Y.js} +2 -2
  21. package/dist/{batch-buffer-BLmVvJAZ.js.map → batch-buffer-C-ETEX3Y.js.map} +1 -1
  22. package/dist/browser.js +15 -11
  23. package/dist/browser.js.map +1 -1
  24. package/dist/browser.mjs +15 -11
  25. package/dist/browser.mjs.map +1 -1
  26. package/dist/{builder-jMlVYaQa.js → builder-CC48eDJ3.js} +58 -250
  27. package/dist/builder-CC48eDJ3.js.map +1 -0
  28. package/dist/{builder-CA_dokb4.mjs → builder-CoisL7S7.mjs} +55 -223
  29. package/dist/builder-CoisL7S7.mjs.map +1 -0
  30. package/dist/cloudwatch.d.mts +1 -1
  31. package/dist/cloudwatch.d.ts +1 -1
  32. package/dist/cloudwatch.js +1 -1
  33. package/dist/cloudwatch.mjs +1 -1
  34. package/dist/{cloudwatch.transport-Cr0fEpko.mjs → cloudwatch.transport-Brh5fmRN.mjs} +3 -3
  35. package/dist/{cloudwatch.transport-Cr0fEpko.mjs.map → cloudwatch.transport-Brh5fmRN.mjs.map} +1 -1
  36. package/dist/{cloudwatch.transport-_hS7Mcc5.d.mts → cloudwatch.transport-CqXAGHPH.d.mts} +2 -2
  37. package/dist/{cloudwatch.transport-_hS7Mcc5.d.mts.map → cloudwatch.transport-CqXAGHPH.d.mts.map} +1 -1
  38. package/dist/{cloudwatch.transport-Lst1Bbmr.js → cloudwatch.transport-DO9e__Z-.js} +3 -3
  39. package/dist/{cloudwatch.transport-Lst1Bbmr.js.map → cloudwatch.transport-DO9e__Z-.js.map} +1 -1
  40. package/dist/{cloudwatch.transport-DdSjUWvu.d.ts → cloudwatch.transport-pY96iAfO.d.ts} +2 -2
  41. package/dist/{cloudwatch.transport-DdSjUWvu.d.ts.map → cloudwatch.transport-pY96iAfO.d.ts.map} +1 -1
  42. package/dist/correlation.js +2 -2
  43. package/dist/correlation.mjs +2 -2
  44. package/dist/error.utils-B8_CwESF.mjs +189 -0
  45. package/dist/error.utils-B8_CwESF.mjs.map +1 -0
  46. package/dist/error.utils-fZkRExam.js +212 -0
  47. package/dist/error.utils-fZkRExam.js.map +1 -0
  48. package/dist/fastify.d.mts +89 -0
  49. package/dist/fastify.d.mts.map +1 -0
  50. package/dist/fastify.d.ts +89 -0
  51. package/dist/fastify.d.ts.map +1 -0
  52. package/dist/fastify.js +265 -0
  53. package/dist/fastify.js.map +1 -0
  54. package/dist/fastify.mjs +263 -0
  55. package/dist/fastify.mjs.map +1 -0
  56. package/dist/gcp.d.mts +1 -1
  57. package/dist/gcp.d.ts +1 -1
  58. package/dist/gcp.js +1 -1
  59. package/dist/gcp.mjs +1 -1
  60. package/dist/{gcp.transport-C8VJiEM7.d.mts → gcp.transport-BFlvl8uy.d.mts} +2 -2
  61. package/dist/{gcp.transport-C8VJiEM7.d.mts.map → gcp.transport-BFlvl8uy.d.mts.map} +1 -1
  62. package/dist/{gcp.transport-Cw3Qke85.mjs → gcp.transport-BY1Z3cS0.mjs} +3 -3
  63. package/dist/{gcp.transport-Cw3Qke85.mjs.map → gcp.transport-BY1Z3cS0.mjs.map} +1 -1
  64. package/dist/{gcp.transport-Ct0BtKFo.d.ts → gcp.transport-Bo60F-_3.d.ts} +2 -2
  65. package/dist/{gcp.transport-Ct0BtKFo.d.ts.map → gcp.transport-Bo60F-_3.d.ts.map} +1 -1
  66. package/dist/{gcp.transport-5-ZIjN8r.js → gcp.transport-V9R4dwdT.js} +3 -3
  67. package/dist/{gcp.transport-5-ZIjN8r.js.map → gcp.transport-V9R4dwdT.js.map} +1 -1
  68. package/dist/hono.d.mts +66 -0
  69. package/dist/hono.d.mts.map +1 -0
  70. package/dist/hono.d.ts +66 -0
  71. package/dist/hono.d.ts.map +1 -0
  72. package/dist/hono.js +512 -0
  73. package/dist/hono.js.map +1 -0
  74. package/dist/hono.mjs +511 -0
  75. package/dist/hono.mjs.map +1 -0
  76. package/dist/{index-B3ajtXJd.d.mts → index-0X_XpQ_f.d.mts} +2 -2
  77. package/dist/{index-B3ajtXJd.d.mts.map → index-0X_XpQ_f.d.mts.map} +1 -1
  78. package/dist/{index-oqD3WNxf.d.ts → index-BnbqeNl6.d.ts} +2 -2
  79. package/dist/{index-oqD3WNxf.d.ts.map → index-BnbqeNl6.d.ts.map} +1 -1
  80. package/dist/index.d.mts +5 -5
  81. package/dist/index.d.ts +5 -5
  82. package/dist/index.js +12 -11
  83. package/dist/index.js.map +1 -1
  84. package/dist/index.mjs +6 -5
  85. package/dist/index.mjs.map +1 -1
  86. package/dist/{logitron-logger-fMOkXr8H.d.mts → logixia-logger-DcvASx5B.d.mts} +2 -2
  87. package/dist/logixia-logger-DcvASx5B.d.mts.map +1 -0
  88. package/dist/{logitron-logger-Csn3e6Qu.d.ts → logixia-logger-cLi5x5I2.d.ts} +2 -2
  89. package/dist/logixia-logger-cLi5x5I2.d.ts.map +1 -0
  90. package/dist/middleware.d.mts +1 -1
  91. package/dist/middleware.d.ts +1 -1
  92. package/dist/middleware.js +1 -1
  93. package/dist/middleware.mjs +1 -1
  94. package/dist/nest.d.mts +2 -2
  95. package/dist/nest.d.mts.map +1 -1
  96. package/dist/nest.d.ts +2 -2
  97. package/dist/nest.d.ts.map +1 -1
  98. package/dist/nest.js +7 -6
  99. package/dist/nest.js.map +1 -1
  100. package/dist/nest.mjs +6 -5
  101. package/dist/nest.mjs.map +1 -1
  102. package/dist/{otel-8ypFGG19.js → otel-D4SdNYhR.js} +5 -7
  103. package/dist/otel-D4SdNYhR.js.map +1 -0
  104. package/dist/{otel-b-s2QbY4.mjs → otel-LeATAHbW.mjs} +5 -7
  105. package/dist/otel-LeATAHbW.mjs.map +1 -0
  106. package/dist/{request-trace-Dekcnenb.mjs → request-trace-B-S5-LVk.mjs} +10 -5
  107. package/dist/request-trace-B-S5-LVk.mjs.map +1 -0
  108. package/dist/{request-trace-C7kXMjx5.js → request-trace-BqU7ARjg.js} +15 -4
  109. package/dist/request-trace-BqU7ARjg.js.map +1 -0
  110. package/dist/{search-BlKBLm5D.d.ts → search-B9fKizkh.d.ts} +2 -2
  111. package/dist/{search-BlKBLm5D.d.ts.map → search-B9fKizkh.d.ts.map} +1 -1
  112. package/dist/{search-B-hJe2N-.d.mts → search-CdTwNSQm.d.mts} +2 -2
  113. package/dist/{search-B-hJe2N-.d.mts.map → search-CdTwNSQm.d.mts.map} +1 -1
  114. package/dist/search.d.mts +1 -1
  115. package/dist/search.d.ts +1 -1
  116. package/dist/{secret-config-GKmb15Me.mjs → secret-config-Cng7XPLx.mjs} +16 -12
  117. package/dist/secret-config-Cng7XPLx.mjs.map +1 -0
  118. package/dist/{secret-config--cVTOWwp.js → secret-config-OqmIPmpV.js} +16 -12
  119. package/dist/secret-config-OqmIPmpV.js.map +1 -0
  120. package/dist/{slack.transport-Cpx5fKga.js → slack.transport-B-IsNaB8.js} +4 -4
  121. package/dist/{slack.transport-Cpx5fKga.js.map → slack.transport-B-IsNaB8.js.map} +1 -1
  122. package/dist/{slack.transport-Qwj9WkrJ.mjs → slack.transport-BXmDHthx.mjs} +4 -4
  123. package/dist/{slack.transport-Qwj9WkrJ.mjs.map → slack.transport-BXmDHthx.mjs.map} +1 -1
  124. package/dist/{slack.transport-5OPL7H3u.d.mts → slack.transport-DAGuMvm7.d.mts} +2 -2
  125. package/dist/{slack.transport-5OPL7H3u.d.mts.map → slack.transport-DAGuMvm7.d.mts.map} +1 -1
  126. package/dist/{slack.transport-BFpBD_Ri.d.ts → slack.transport-LvYsOoFZ.d.ts} +2 -2
  127. package/dist/{slack.transport-BFpBD_Ri.d.ts.map → slack.transport-LvYsOoFZ.d.ts.map} +1 -1
  128. package/dist/testing.d.mts +1 -1
  129. package/dist/testing.d.ts +1 -1
  130. package/dist/{transport.types-B1ejJJP6.d.mts → transport.types-MjMDjOQ7.d.mts} +6 -1
  131. package/dist/{transport.types-B1ejJJP6.d.mts.map → transport.types-MjMDjOQ7.d.mts.map} +1 -1
  132. package/dist/{transport.types-B1ejJJP6.d.ts → transport.types-MjMDjOQ7.d.ts} +6 -1
  133. package/dist/{transport.types-B1ejJJP6.d.ts.map → transport.types-MjMDjOQ7.d.ts.map} +1 -1
  134. package/dist/transports.d.mts +8 -10
  135. package/dist/transports.d.mts.map +1 -1
  136. package/dist/transports.d.ts +8 -10
  137. package/dist/transports.d.ts.map +1 -1
  138. package/dist/transports.js +6 -6
  139. package/dist/transports.mjs +6 -6
  140. package/dist/worker-entry.js +15 -11
  141. package/dist/worker.d.mts +1 -1
  142. package/dist/worker.d.ts +1 -1
  143. package/dist/worker.js +1 -1
  144. package/dist/worker.mjs +1 -1
  145. package/dist/{worker.transport-B7olL1Uh.d.ts → worker.transport-ByBBDx7U.d.ts} +2 -2
  146. package/dist/{worker.transport-B7olL1Uh.d.ts.map → worker.transport-ByBBDx7U.d.ts.map} +1 -1
  147. package/dist/{worker.transport-C7jNGhev.js → worker.transport-CZOutlxC.js} +2 -2
  148. package/dist/{worker.transport-C7jNGhev.js.map → worker.transport-CZOutlxC.js.map} +1 -1
  149. package/dist/{worker.transport-BHnWDXPH.mjs → worker.transport-CxFD8mvS.mjs} +2 -2
  150. package/dist/{worker.transport-BHnWDXPH.mjs.map → worker.transport-CxFD8mvS.mjs.map} +1 -1
  151. package/dist/{worker.transport-DnU0_9Bd.d.mts → worker.transport-DWyyRVJW.d.mts} +2 -2
  152. package/dist/{worker.transport-DnU0_9Bd.d.mts.map → worker.transport-DWyyRVJW.d.mts.map} +1 -1
  153. package/package.json +37 -2
  154. package/dist/builder-CA_dokb4.mjs.map +0 -1
  155. package/dist/builder-jMlVYaQa.js.map +0 -1
  156. package/dist/logitron-logger-Csn3e6Qu.d.ts.map +0 -1
  157. package/dist/logitron-logger-fMOkXr8H.d.mts.map +0 -1
  158. package/dist/otel-8ypFGG19.js.map +0 -1
  159. package/dist/otel-b-s2QbY4.mjs.map +0 -1
  160. package/dist/request-trace-C7kXMjx5.js.map +0 -1
  161. package/dist/request-trace-Dekcnenb.mjs.map +0 -1
  162. package/dist/secret-config--cVTOWwp.js.map +0 -1
  163. package/dist/secret-config-GKmb15Me.mjs.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { t as assignOwn } from "./own-property-CjFw9qwZ.mjs";
2
- import { o as TraceContext } from "./request-trace-Dekcnenb.mjs";
3
- import { t as LogixiaContext } from "./async-context-fBqC5lNc.mjs";
2
+ import { s as TraceContext } from "./request-trace-B-S5-LVk.mjs";
3
+ import { t as LogixiaContext } from "./async-context-DJdxbbCU.mjs";
4
4
  import { a as buildNameSet, n as DEFAULT_REDACT_QUERY_PARAMS, o as redactUrlQuery, r as SENSITIVE_KEY_NAMES, s as redactUrlsInText } from "./sensitive-names-BiBM6R1X.mjs";
5
- import { n as protectSecrets } from "./secret-config-GKmb15Me.mjs";
5
+ import { n as protectSecrets } from "./secret-config-Cng7XPLx.mjs";
6
6
  import { n as internalLog, r as internalWarn, t as internalError } from "./internal-log-Cy5nF1ZL.mjs";
7
7
  import { i as stringifyForLog } from "./safe-stringify-B5p5ktFe.mjs";
8
8
  import { n as safeToString } from "./csv.utils-ZdxSod5g.mjs";
9
- import { c as TransportManager, n as _getOtelPayloadIfEnabled, r as _isOtelBridgeEnabled, v as stripControlChars } from "./otel-b-s2QbY4.mjs";
9
+ import { c as TransportManager, n as _getOtelPayloadIfEnabled, r as _isOtelBridgeEnabled, v as stripControlChars } from "./otel-LeATAHbW.mjs";
10
+ import { i as serializeNestedErrors, r as serializeError, t as isError } from "./error.utils-B8_CwESF.mjs";
10
11
  import { constants } from "node:os";
11
12
  // src/types/index.ts
12
13
  const LogLevel = {
@@ -180,191 +181,6 @@ const globalPluginRegistry = new PluginRegistry();
180
181
  function usePlugin(plugin) {
181
182
  globalPluginRegistry.register(plugin);
182
183
  }
183
- // src/utils/error.utils.ts
184
- const EXTRA_FIELDS = [
185
- "code",
186
- "statusCode",
187
- "status",
188
- "errno",
189
- "syscall",
190
- "path",
191
- "address",
192
- "port",
193
- "type"
194
- ];
195
- const SKIPPED_FIELDS = /* @__PURE__ */ new Set([
196
- "name",
197
- "message",
198
- "stack",
199
- "cause",
200
- "errors",
201
- ...EXTRA_FIELDS
202
- ]);
203
- const NO_OPTIONS = Object.freeze({});
204
- const NO_FIELDS = [];
205
- /**
206
- * Serialize an Error into a plain JSON-safe object, including:
207
- * - `name`, `message`, `stack`
208
- * - `cause` (recursively serialized, full ES2022 chain)
209
- * - `errors` (for AggregateError)
210
- * - standard Node.js error fields (`code`, `statusCode`, `errno`, …)
211
- * - any other enumerable own properties
212
- */
213
- function serializeError(error, options = NO_OPTIONS) {
214
- const { includeStack = true, maxDepth = 5, excludeFields = NO_FIELDS } = options;
215
- return _serializeError(error, includeStack, maxDepth, excludeFields, 0, /* @__PURE__ */ new WeakSet());
216
- }
217
- function _serializeError(error, includeStack, maxDepth, excludeFields, depth, seen) {
218
- if (depth >= maxDepth) return {
219
- name: error.name,
220
- message: error.message,
221
- _truncated: true
222
- };
223
- if (seen.has(error)) return {
224
- name: error.name,
225
- message: error.message,
226
- _circular: true
227
- };
228
- seen.add(error);
229
- const serialized = {
230
- name: error.name,
231
- message: error.message
232
- };
233
- if (includeStack && error.stack) serialized.stack = error.stack;
234
- const errorWithCause = error;
235
- if (errorWithCause.cause !== void 0) {
236
- if (errorWithCause.cause instanceof Error) serialized.cause = _serializeError(errorWithCause.cause, includeStack, maxDepth, excludeFields, depth + 1, seen);
237
- else serialized.cause = serializeValue(errorWithCause.cause, maxDepth - depth - 1, seen);
238
- }
239
- const aggregateError = error;
240
- if (Array.isArray(aggregateError.errors)) serialized.errors = aggregateError.errors.map((e) => e instanceof Error ? _serializeError(e, includeStack, maxDepth, excludeFields, depth + 1, seen) : serializeValue(e, maxDepth - depth - 1, seen));
241
- const errorRecord = error;
242
- for (const field of EXTRA_FIELDS) if (!excludeFields.includes(field) && errorRecord[field] !== void 0) serialized[field] = errorRecord[field];
243
- const skip = excludeFields.length === 0 ? SKIPPED_FIELDS : /* @__PURE__ */ new Set([...SKIPPED_FIELDS, ...excludeFields]);
244
- for (const key of Object.getOwnPropertyNames(error)) {
245
- if (skip.has(key)) continue;
246
- try {
247
- assignOwn(serialized, key, serializeValue(errorRecord[key], maxDepth - depth - 1, seen));
248
- } catch {
249
- assignOwn(serialized, key, "[Unserializable]");
250
- }
251
- }
252
- return serialized;
253
- }
254
- /**
255
- * Recursively serialize an arbitrary value to a JSON-safe representation.
256
- *
257
- * The `seen` guard is threaded through (not recreated) so cross-referencing
258
- * errors nested inside plain objects/arrays are caught by the same circular
259
- * check that protects the top-level error tree, rather than only relying on the
260
- * depth limit.
261
- */
262
- function serializeValue(value, remainingDepth, seen) {
263
- if (remainingDepth <= 0) return "[Max Depth]";
264
- if (value === null || value === void 0) return value;
265
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
266
- if (value instanceof Date) return value.toISOString();
267
- if (value instanceof Error) {
268
- if (seen.has(value)) return {
269
- name: value.name,
270
- message: value.message,
271
- _circular: true
272
- };
273
- return _serializeError(value, true, remainingDepth, [], 0, seen);
274
- }
275
- if (Array.isArray(value)) {
276
- if (seen.has(value)) return "[Circular]";
277
- seen.add(value);
278
- return value.map((item) => serializeValue(item, remainingDepth - 1, seen));
279
- }
280
- if (typeof value === "object") {
281
- if (seen.has(value)) return "[Circular]";
282
- seen.add(value);
283
- const out = {};
284
- for (const [k, v] of Object.entries(value)) try {
285
- assignOwn(out, k, serializeValue(v, remainingDepth - 1, seen));
286
- } catch {
287
- assignOwn(out, k, "[Unserializable]");
288
- }
289
- return out;
290
- }
291
- return String(value);
292
- }
293
- /**
294
- * Type guard: returns true if the value looks like an Error object.
295
- */
296
- function isError(value) {
297
- return value instanceof Error || Boolean(value) && typeof value === "object" && "name" in value && "message" in value;
298
- }
299
- const MAX_ERROR_SEARCH_DEPTH = 3;
300
- const MAX_ERROR_SEARCH_NODES = 2e3;
301
- /**
302
- * Replaces real Error instances inside a log payload with their serialized form,
303
- * because JSON output drops an Error's non-enumerable `message` and `stack`. Runs on
304
- * every log call, so its work is capped and it copies nothing until it finds one.
305
- * Duck-typed objects are data, and an Error with its own toJSON has already chosen
306
- * what to show. The caller's objects are never mutated.
307
- */
308
- function serializeNestedErrors(data) {
309
- const outerBudget = errorSearchBudget;
310
- errorSearchBudget = MAX_ERROR_SEARCH_NODES;
311
- try {
312
- return walkForErrors(data, MAX_ERROR_SEARCH_DEPTH, void 0, void 0);
313
- } finally {
314
- errorSearchBudget = outerBudget;
315
- }
316
- }
317
- let errorSearchBudget = 0;
318
- const hasOwn = Object.prototype.hasOwnProperty;
319
- function walkForErrors(value, depth, parent, grandparent) {
320
- if (value instanceof Error) return typeof value.toJSON === "function" ? value : serializeError(value);
321
- if (depth === 0 || --errorSearchBudget < 0 || value === parent || value === grandparent) return value;
322
- let copy;
323
- if (Array.isArray(value)) for (let i = 0; i < value.length; i++) {
324
- const item = value[i];
325
- if (item === null || typeof item !== "object") continue;
326
- const next = walkForErrors(item, depth - 1, value, parent);
327
- if (next !== item) {
328
- copy ??= value.slice();
329
- copy[i] = next;
330
- }
331
- }
332
- else {
333
- const proto = Object.getPrototypeOf(value);
334
- if (proto !== Object.prototype && proto !== null) return value;
335
- const record = value;
336
- for (const key in record) {
337
- if (!hasOwn.call(record, key)) continue;
338
- let item;
339
- try {
340
- item = record[key];
341
- } catch {
342
- continue;
343
- }
344
- if (item === null || typeof item !== "object") continue;
345
- const next = walkForErrors(item, depth - 1, record, parent);
346
- if (next !== item) {
347
- copy ??= { ...record };
348
- assignOwn(copy, key, next);
349
- }
350
- }
351
- }
352
- return copy ?? value;
353
- }
354
- /**
355
- * Coerce any thrown value into a proper Error instance.
356
- */
357
- function normalizeError(error) {
358
- if (isError(error)) return error;
359
- if (typeof error === "string") return new Error(error);
360
- if (typeof error === "object" && error !== null) {
361
- const e = error;
362
- const err = new Error(typeof e["message"] === "string" ? e["message"] : "Unknown error");
363
- Object.assign(err, error);
364
- return err;
365
- }
366
- return new Error(String(error));
367
- }
368
184
  // src/utils/redact.utils.ts
369
185
  const DEFAULT_CENSOR = "[REDACTED]";
370
186
  /** Maximum nesting depth walked; deeper values are replaced with a marker. */
@@ -1102,7 +918,7 @@ function warnOnReservedLevelNames(levels) {
1102
918
  if (clashes.length > 0) internalWarn(`levelOptions.levels uses reserved logger method name(s): ${clashes.join(", ")}. No level shortcut is created for them; use logger.logLevel(name, ...) or rename the level.`);
1103
919
  return clashes;
1104
920
  }
1105
- // src/core/logitron-logger.ts
921
+ // src/core/logixia-logger.ts
1106
922
  /**
1107
923
  * Core Logixia Logger implementation
1108
924
  *
@@ -1125,6 +941,26 @@ function nowIso() {
1125
941
  }
1126
942
  const RESOLVED = Promise.resolve();
1127
943
  const UNSERIALIZABLE = "[Unserializable]";
944
+ const ANSI_COLORS = /* @__PURE__ */ new Map([
945
+ ["black", "\x1B[30m"],
946
+ ["red", "\x1B[31m"],
947
+ ["green", "\x1B[32m"],
948
+ ["yellow", "\x1B[33m"],
949
+ ["blue", "\x1B[34m"],
950
+ ["magenta", "\x1B[35m"],
951
+ ["cyan", "\x1B[36m"],
952
+ ["white", "\x1B[37m"],
953
+ ["gray", "\x1B[90m"],
954
+ ["grey", "\x1B[90m"],
955
+ ["brightred", "\x1B[91m"],
956
+ ["brightgreen", "\x1B[92m"],
957
+ ["brightyellow", "\x1B[93m"],
958
+ ["brightblue", "\x1B[94m"],
959
+ ["brightmagenta", "\x1B[95m"],
960
+ ["brightcyan", "\x1B[96m"],
961
+ ["brightwhite", "\x1B[97m"],
962
+ ["reset", "\x1B[0m"]
963
+ ]);
1128
964
  const JSON_STRING_FIELDS = [
1129
965
  "timestamp",
1130
966
  "level",
@@ -1261,7 +1097,7 @@ var LogixiaLogger = class LogixiaLogger {
1261
1097
  /** `source=value` pairs already reported as unknown levels — warn once per logger. */
1262
1098
  _warnedInvalidLevels = /* @__PURE__ */ new Set();
1263
1099
  /** Pre-built ANSI color codes to avoid recreating the object in colorize(). */
1264
- _colorMap = /* @__PURE__ */ new Map();
1100
+ _colorMap = ANSI_COLORS;
1265
1101
  /** Pre-computed field-enabled booleans so isFieldEnabled() isn't called per log. */
1266
1102
  _fieldCache = /* @__PURE__ */ new Map();
1267
1103
  /** True when contextData is non-empty — avoids Object.keys() check on hot path. */
@@ -1333,15 +1169,21 @@ var LogixiaLogger = class LogixiaLogger {
1333
1169
  }
1334
1170
  }
1335
1171
  };
1336
- this.config = {
1337
- ...defaultConfig,
1338
- ...config
1339
- };
1340
- const resolvedLevel = resolveInitialLevel(this.config);
1341
- this.config.levelOptions = {
1342
- ...this.config.levelOptions,
1343
- level: resolvedLevel
1172
+ if (parent) this.config = {
1173
+ ...config,
1174
+ levelOptions: { ...config.levelOptions }
1344
1175
  };
1176
+ else {
1177
+ this.config = {
1178
+ ...defaultConfig,
1179
+ ...config
1180
+ };
1181
+ const resolvedLevel = resolveInitialLevel(this.config);
1182
+ this.config.levelOptions = {
1183
+ ...this.config.levelOptions,
1184
+ level: resolvedLevel
1185
+ };
1186
+ }
1345
1187
  this.config.fields ??= {
1346
1188
  timestamp: "[yyyy-mm-dd HH:MM:ss.MS]",
1347
1189
  level: "[log_level]",
@@ -1376,7 +1218,7 @@ var LogixiaLogger = class LogixiaLogger {
1376
1218
  if (!parent) this.setupGracefulShutdown();
1377
1219
  this.createCustomLevelMethods();
1378
1220
  if (!parent) for (const p of globalPluginRegistry._plugins) this._pluginRegistry.register(p);
1379
- this._buildPerfCaches();
1221
+ this._buildPerfCaches(parent);
1380
1222
  }
1381
1223
  setupGracefulShutdown() {
1382
1224
  const shutdownCfg = this.config.gracefulShutdown;
@@ -1407,8 +1249,17 @@ var LogixiaLogger = class LogixiaLogger {
1407
1249
  * Rebuild all hot-path caches after any config mutation or level change.
1408
1250
  * Keeps the actual log() call free of allocations in the common case.
1409
1251
  */
1410
- _buildPerfCaches() {
1252
+ _buildPerfCaches(inheritFrom) {
1411
1253
  var _this$config$levelOpt4, _this$config$format, _this$config$redact$p, _this$config$redact$p2;
1254
+ if (inheritFrom && inheritFrom.fieldState.size === 0) {
1255
+ this._levelValues = inheritFrom._levelValues;
1256
+ this._fieldCache = new Map(inheritFrom._fieldCache);
1257
+ this._formattedLevels = inheritFrom._formattedLevels;
1258
+ this._formattedAppName = inheritFrom._formattedAppName;
1259
+ this._hasRedact = inheritFrom._hasRedact;
1260
+ this._minLevelValue = this._levelValues.get(this.resolveEffectiveLevel()) ?? 2;
1261
+ return;
1262
+ }
1412
1263
  const customLevelEntries = Object.entries(((_this$config$levelOpt4 = this.config.levelOptions) === null || _this$config$levelOpt4 === void 0 ? void 0 : _this$config$levelOpt4.levels) ?? {});
1413
1264
  this._levelValues = new Map([
1414
1265
  [LogLevel.ERROR, 0],
@@ -1423,26 +1274,7 @@ var LogixiaLogger = class LogixiaLogger {
1423
1274
  this.config.levelOptions.level = this._validLevel(this.config.levelOptions.level, "levelOptions.level") ?? LogLevel.INFO;
1424
1275
  const effectiveLevel = this.resolveEffectiveLevel();
1425
1276
  this._minLevelValue = this._levelValues.get(effectiveLevel) ?? 2;
1426
- this._colorMap = /* @__PURE__ */ new Map([
1427
- ["black", "\x1B[30m"],
1428
- ["red", "\x1B[31m"],
1429
- ["green", "\x1B[32m"],
1430
- ["yellow", "\x1B[33m"],
1431
- ["blue", "\x1B[34m"],
1432
- ["magenta", "\x1B[35m"],
1433
- ["cyan", "\x1B[36m"],
1434
- ["white", "\x1B[37m"],
1435
- ["gray", "\x1B[90m"],
1436
- ["grey", "\x1B[90m"],
1437
- ["brightred", "\x1B[91m"],
1438
- ["brightgreen", "\x1B[92m"],
1439
- ["brightyellow", "\x1B[93m"],
1440
- ["brightblue", "\x1B[94m"],
1441
- ["brightmagenta", "\x1B[95m"],
1442
- ["brightcyan", "\x1B[96m"],
1443
- ["brightwhite", "\x1B[97m"],
1444
- ["reset", "\x1B[0m"]
1445
- ]);
1277
+ this._colorMap = ANSI_COLORS;
1446
1278
  for (const f of [
1447
1279
  "timestamp",
1448
1280
  "level",
@@ -2328,6 +2160,6 @@ var ErrorResponseBuilder = class {
2328
2160
  };
2329
2161
  }
2330
2162
  };
2331
- export { DEFAULT_LOG_COLORS as C, DEFAULT_CONFIG as S, LogLevel as T, serializeError as _, isLogixiaException as a, globalPluginRegistry as b, _shutdownRegistrySize as c, registerForShutdown as d, resetShutdownHandlers as f, normalizeError as g, isError as h, LogixiaException as i, deregisterFromShutdown as l, redactObject as m, generateRequestId as n, LogixiaLogger as o, applyRedaction as p, generateTraceId as r, createLogger as s, ErrorResponseBuilder as t, flushOnExit as u, serializeNestedErrors as v, DEFAULT_LOG_LEVELS as w, usePlugin as x, PluginRegistry as y };
2163
+ export { usePlugin as _, isLogixiaException as a, DEFAULT_LOG_LEVELS as b, _shutdownRegistrySize as c, registerForShutdown as d, resetShutdownHandlers as f, globalPluginRegistry as g, PluginRegistry as h, LogixiaException as i, deregisterFromShutdown as l, redactObject as m, generateRequestId as n, LogixiaLogger as o, applyRedaction as p, generateTraceId as r, createLogger as s, ErrorResponseBuilder as t, flushOnExit as u, DEFAULT_CONFIG as v, LogLevel as x, DEFAULT_LOG_COLORS as y };
2332
2164
 
2333
- //# sourceMappingURL=builder-CA_dokb4.mjs.map
2165
+ //# sourceMappingURL=builder-CoisL7S7.mjs.map