@mks2508/better-logger 0.18.2-alpha.1 → 0.18.3

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 (207) hide show
  1. package/README.md +38 -336
  2. package/dist/Logger.d.ts +356 -157
  3. package/dist/Logger.d.ts.map +1 -1
  4. package/dist/ScopedLogger.d.ts +549 -9
  5. package/dist/ScopedLogger.d.ts.map +1 -1
  6. package/dist/chunks/HookBridge-C-AvXmPD.cjs +504 -0
  7. package/dist/chunks/HookBridge-C-AvXmPD.cjs.map +1 -0
  8. package/dist/chunks/HookBridge-CI2PH79S.js +487 -0
  9. package/dist/chunks/HookBridge-CI2PH79S.js.map +1 -0
  10. package/dist/chunks/{LogContext-L7HzynFw.cjs → LogContext-BaMXleWj.cjs} +19 -4
  11. package/dist/chunks/LogContext-BaMXleWj.cjs.map +1 -0
  12. package/dist/chunks/LogContext-DZasm_P5.cjs +141 -0
  13. package/dist/chunks/LogContext-DZasm_P5.cjs.map +1 -0
  14. package/dist/chunks/{LogContext-Cwn-1Zzb.js → LogContext-DjlITOzZ.js} +19 -4
  15. package/dist/chunks/LogContext-DjlITOzZ.js.map +1 -0
  16. package/dist/chunks/LogContext-Dyzs61XG.js +136 -0
  17. package/dist/chunks/LogContext-Dyzs61XG.js.map +1 -0
  18. package/dist/chunks/SerializerBridge-Ba43Mk7j.js +393 -0
  19. package/dist/chunks/SerializerBridge-Ba43Mk7j.js.map +1 -0
  20. package/dist/chunks/SerializerBridge-C4a9Z37F.cjs +410 -0
  21. package/dist/chunks/SerializerBridge-C4a9Z37F.cjs.map +1 -0
  22. package/dist/chunks/{StyleManager-CIpd6wbO.cjs → StyleManager-DQ6UNRB-.cjs} +37 -11
  23. package/dist/chunks/StyleManager-DQ6UNRB-.cjs.map +1 -0
  24. package/dist/chunks/StyleManager-DjwAYbxE.js +113 -0
  25. package/dist/chunks/StyleManager-DjwAYbxE.js.map +1 -0
  26. package/dist/chunks/{core-PoT7RrTK.js → core-Blfi2klP.js} +1 -4
  27. package/dist/chunks/core-Blfi2klP.js.map +1 -0
  28. package/dist/chunks/{core-Dzz7agGa.cjs → core-CqS_UBzJ.cjs} +1 -4
  29. package/dist/chunks/core-CqS_UBzJ.cjs.map +1 -0
  30. package/dist/chunks/{environment-detector-CI3TrWK_.js → environment-detector-7NvnYUfr.js} +11 -11
  31. package/dist/chunks/environment-detector-7NvnYUfr.js.map +1 -0
  32. package/dist/chunks/{environment-detector-Cnn6wr6O.cjs → environment-detector-D-tHkKWA.cjs} +11 -11
  33. package/dist/chunks/environment-detector-D-tHkKWA.cjs.map +1 -0
  34. package/dist/chunks/server-fallback-CaCPjWby.cjs +119 -0
  35. package/dist/chunks/server-fallback-CaCPjWby.cjs.map +1 -0
  36. package/dist/chunks/server-fallback-jj0T6XaK.js +114 -0
  37. package/dist/chunks/server-fallback-jj0T6XaK.js.map +1 -0
  38. package/dist/chunks/{spinner-DNvxbM9a.cjs → spinner-BHyYEXsM.cjs} +319 -37
  39. package/dist/chunks/spinner-BHyYEXsM.cjs.map +1 -0
  40. package/dist/chunks/{spinner-D3FsF78o.js → spinner-BtkwpzYv.js} +319 -37
  41. package/dist/chunks/spinner-BtkwpzYv.js.map +1 -0
  42. package/dist/chunks/styling-CRw3KQW4.js +1592 -0
  43. package/dist/chunks/styling-CRw3KQW4.js.map +1 -0
  44. package/dist/chunks/styling-Cel2wPRy.cjs +1645 -0
  45. package/dist/chunks/styling-Cel2wPRy.cjs.map +1 -0
  46. package/dist/chunks/transports-BGfwwakw.js +1237 -0
  47. package/dist/chunks/transports-BGfwwakw.js.map +1 -0
  48. package/dist/chunks/transports-BZ-Mc2IT.cjs +1450 -0
  49. package/dist/chunks/transports-BZ-Mc2IT.cjs.map +1 -0
  50. package/dist/chunks/transports-DvaLAeGJ.js +1403 -0
  51. package/dist/chunks/transports-DvaLAeGJ.js.map +1 -0
  52. package/dist/chunks/transports-yK6CL0Ml.cjs +1278 -0
  53. package/dist/chunks/transports-yK6CL0Ml.cjs.map +1 -0
  54. package/dist/chunks/{utils-BqlFYocD.cjs → utils-W_cxqriN.cjs} +44 -37
  55. package/dist/chunks/utils-W_cxqriN.cjs.map +1 -0
  56. package/dist/chunks/{utils-VETbVpkR.js → utils-tKfBAWUM.js} +44 -37
  57. package/dist/chunks/utils-tKfBAWUM.js.map +1 -0
  58. package/dist/cli/CommandProcessor.d.ts +166 -19
  59. package/dist/cli/CommandProcessor.d.ts.map +1 -1
  60. package/dist/cli/commands/ConfigCommand.d.ts +36 -1
  61. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -1
  62. package/dist/cli/commands/ExportCommand.d.ts +49 -3
  63. package/dist/cli/commands/ExportCommand.d.ts.map +1 -1
  64. package/dist/cli/commands/ThemeCommand.d.ts +62 -3
  65. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -1
  66. package/dist/cli/help.d.ts +30 -2
  67. package/dist/cli/help.d.ts.map +1 -1
  68. package/dist/cli/index.d.ts +29 -2
  69. package/dist/cli/index.d.ts.map +1 -1
  70. package/dist/cli.cjs +2 -2
  71. package/dist/cli.js +2 -2
  72. package/dist/context/LogContext.d.ts +167 -70
  73. package/dist/context/LogContext.d.ts.map +1 -1
  74. package/dist/context.cjs +1 -1
  75. package/dist/context.js +1 -1
  76. package/dist/core.cjs +52 -29
  77. package/dist/core.cjs.map +1 -1
  78. package/dist/core.d.ts +50 -27
  79. package/dist/core.d.ts.map +1 -1
  80. package/dist/core.js +52 -29
  81. package/dist/core.js.map +1 -1
  82. package/dist/hooks/HookBridge.d.ts +15 -9
  83. package/dist/hooks/HookBridge.d.ts.map +1 -1
  84. package/dist/hooks/HookManager.d.ts +295 -2
  85. package/dist/hooks/HookManager.d.ts.map +1 -1
  86. package/dist/hooks.cjs +1 -1
  87. package/dist/hooks.js +1 -1
  88. package/dist/index.cjs +1415 -214
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.ts +5 -1
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1413 -215
  93. package/dist/index.js.map +1 -1
  94. package/dist/playground/TerminalBridge.d.ts +23 -16
  95. package/dist/playground/TerminalBridge.d.ts.map +1 -1
  96. package/dist/playground/box.d.ts +36 -5
  97. package/dist/playground/box.d.ts.map +1 -1
  98. package/dist/playground/cli-table.d.ts +41 -5
  99. package/dist/playground/cli-table.d.ts.map +1 -1
  100. package/dist/playground/divider.d.ts +22 -3
  101. package/dist/playground/divider.d.ts.map +1 -1
  102. package/dist/playground/header.d.ts +21 -4
  103. package/dist/playground/header.d.ts.map +1 -1
  104. package/dist/playground/server-fallback.d.ts +96 -9
  105. package/dist/playground/server-fallback.d.ts.map +1 -1
  106. package/dist/playground/spinner.d.ts +159 -10
  107. package/dist/playground/spinner.d.ts.map +1 -1
  108. package/dist/playground/step.d.ts +25 -6
  109. package/dist/playground/step.d.ts.map +1 -1
  110. package/dist/playground.cjs +1 -1
  111. package/dist/playground.js +1 -1
  112. package/dist/serializers/SerializerBridge.d.ts +13 -6
  113. package/dist/serializers/SerializerBridge.d.ts.map +1 -1
  114. package/dist/serializers/SerializerRegistry.d.ts +236 -0
  115. package/dist/serializers/SerializerRegistry.d.ts.map +1 -1
  116. package/dist/serializers.cjs +1 -1
  117. package/dist/serializers.js +1 -1
  118. package/dist/styles/StyleManager.d.ts +138 -31
  119. package/dist/styles/StyleManager.d.ts.map +1 -1
  120. package/dist/styles.cjs +2 -2
  121. package/dist/styles.js +2 -2
  122. package/dist/styling/SmartPresets.d.ts +100 -6
  123. package/dist/styling/SmartPresets.d.ts.map +1 -1
  124. package/dist/styling/StyleBuilder.d.ts +453 -32
  125. package/dist/styling/StyleBuilder.d.ts.map +1 -1
  126. package/dist/styling/banners.d.ts +83 -7
  127. package/dist/styling/banners.d.ts.map +1 -1
  128. package/dist/styling/themes.d.ts +41 -2
  129. package/dist/styling/themes.d.ts.map +1 -1
  130. package/dist/transports/ConsoleTransport.d.ts +95 -0
  131. package/dist/transports/ConsoleTransport.d.ts.map +1 -1
  132. package/dist/transports/FileTransport.d.ts +99 -18
  133. package/dist/transports/FileTransport.d.ts.map +1 -1
  134. package/dist/transports/HttpTransport.d.ts +135 -22
  135. package/dist/transports/HttpTransport.d.ts.map +1 -1
  136. package/dist/transports/OtlpTraceTransport.d.ts +118 -0
  137. package/dist/transports/OtlpTraceTransport.d.ts.map +1 -0
  138. package/dist/transports/OtlpTransport.d.ts +80 -37
  139. package/dist/transports/OtlpTransport.d.ts.map +1 -1
  140. package/dist/transports/SpanRuntime.d.ts +73 -0
  141. package/dist/transports/SpanRuntime.d.ts.map +1 -0
  142. package/dist/transports/TransportBridge.d.ts +19 -13
  143. package/dist/transports/TransportBridge.d.ts.map +1 -1
  144. package/dist/transports/TransportManager.d.ts +232 -10
  145. package/dist/transports/TransportManager.d.ts.map +1 -1
  146. package/dist/transports/index.d.ts +1 -0
  147. package/dist/transports/index.d.ts.map +1 -1
  148. package/dist/transports-module.d.ts +3 -1
  149. package/dist/transports-module.d.ts.map +1 -1
  150. package/dist/transports.cjs +2 -1
  151. package/dist/transports.js +2 -2
  152. package/dist/types/core.d.ts +155 -59
  153. package/dist/types/core.d.ts.map +1 -1
  154. package/dist/types/hooks.d.ts +92 -14
  155. package/dist/types/hooks.d.ts.map +1 -1
  156. package/dist/types/index.d.ts +1 -1
  157. package/dist/types/index.d.ts.map +1 -1
  158. package/dist/types/serializers.d.ts +72 -0
  159. package/dist/types/serializers.d.ts.map +1 -1
  160. package/dist/types/transports.d.ts +163 -39
  161. package/dist/types/transports.d.ts.map +1 -1
  162. package/dist/utils/ansi-colors.d.ts +15 -15
  163. package/dist/utils/asyncLocalStorage.d.ts +33 -0
  164. package/dist/utils/asyncLocalStorage.d.ts.map +1 -0
  165. package/dist/utils/environment-detector.d.ts +11 -11
  166. package/dist/utils/formatting.d.ts +8 -8
  167. package/dist/utils/output.d.ts +9 -9
  168. package/dist/utils/output.d.ts.map +1 -1
  169. package/dist/utils/stackTrace.d.ts +2 -2
  170. package/package.json +24 -25
  171. package/dist/chunks/HookBridge-CiRfR67f.cjs +0 -190
  172. package/dist/chunks/HookBridge-CiRfR67f.cjs.map +0 -1
  173. package/dist/chunks/HookBridge-SgMmbXZB.js +0 -173
  174. package/dist/chunks/HookBridge-SgMmbXZB.js.map +0 -1
  175. package/dist/chunks/LogContext-Cwn-1Zzb.js.map +0 -1
  176. package/dist/chunks/LogContext-L7HzynFw.cjs.map +0 -1
  177. package/dist/chunks/SerializerBridge-BaOQOb8q.cjs +0 -166
  178. package/dist/chunks/SerializerBridge-BaOQOb8q.cjs.map +0 -1
  179. package/dist/chunks/SerializerBridge-BkpQu5c9.js +0 -149
  180. package/dist/chunks/SerializerBridge-BkpQu5c9.js.map +0 -1
  181. package/dist/chunks/StyleManager-CIpd6wbO.cjs.map +0 -1
  182. package/dist/chunks/StyleManager-LCvVlVdx.js +0 -87
  183. package/dist/chunks/StyleManager-LCvVlVdx.js.map +0 -1
  184. package/dist/chunks/core-Dzz7agGa.cjs.map +0 -1
  185. package/dist/chunks/core-PoT7RrTK.js.map +0 -1
  186. package/dist/chunks/environment-detector-CI3TrWK_.js.map +0 -1
  187. package/dist/chunks/environment-detector-Cnn6wr6O.cjs.map +0 -1
  188. package/dist/chunks/server-fallback-BUKjdLS7.cjs +0 -42
  189. package/dist/chunks/server-fallback-BUKjdLS7.cjs.map +0 -1
  190. package/dist/chunks/server-fallback-BsuWH1Dk.js +0 -37
  191. package/dist/chunks/server-fallback-BsuWH1Dk.js.map +0 -1
  192. package/dist/chunks/spinner-D3FsF78o.js.map +0 -1
  193. package/dist/chunks/spinner-DNvxbM9a.cjs.map +0 -1
  194. package/dist/chunks/styling-84N8T97t.js +0 -941
  195. package/dist/chunks/styling-84N8T97t.js.map +0 -1
  196. package/dist/chunks/styling-Cg5saQ46.cjs +0 -994
  197. package/dist/chunks/styling-Cg5saQ46.cjs.map +0 -1
  198. package/dist/chunks/transports-BiDk345e.js +0 -715
  199. package/dist/chunks/transports-BiDk345e.js.map +0 -1
  200. package/dist/chunks/transports-COPWmlF1.cjs +0 -756
  201. package/dist/chunks/transports-COPWmlF1.cjs.map +0 -1
  202. package/dist/chunks/utils-BqlFYocD.cjs.map +0 -1
  203. package/dist/chunks/utils-VETbVpkR.js.map +0 -1
  204. package/dist/example.d.ts +0 -18
  205. package/dist/example.d.ts.map +0 -1
  206. package/dist/main.d.ts +0 -2
  207. package/dist/main.d.ts.map +0 -1
package/dist/Logger.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Sistema de logging profesional con estilos CSS avanzados, temas adaptativos,
5
5
  * badges automáticos, contextos temporales y exportación de datos.
6
6
  */
7
- import type { LogLevel, LogTag, Verbosity, ThemeVariant, BannerType, LoggerConfig, ILogHandler, StyleOptions, Bindings, SerializerFn, HookEvent, HookCallback, MiddlewareFn, TransportTarget, TransportRecord, ILogResourceRef, StackInfo } from './types/index.js';
7
+ import type { LogLevel, LogTag, Verbosity, ThemeVariant, BannerType, LoggerConfig, ILogHandler, StyleOptions, Bindings, SerializerFn, HookEvent, HookCallback, MiddlewareFn, TransportTarget, TransportRecord, ILogResourceRef, StackInfo, Span, SpanAttributes } from './types/index.js';
8
8
  import { SerializerRegistry } from './serializers/index.js';
9
9
  import { HookManager } from './hooks/index.js';
10
10
  import { TransportManager } from './transports/index.js';
@@ -49,37 +49,38 @@ export declare class Logger {
49
49
  private hookBridge;
50
50
  private logContext;
51
51
  private transportBridge;
52
- /** Set during success() so log() skips its own dispatch (N2 fix). */
52
+ /** Fijado por `success()` para que `log()` salte su propio dispatch. */
53
53
  private _successTagDispatched;
54
54
  private styleManager;
55
- /** Whether CLI primitives (step, box, header, etc.) should be shown*/
55
+ /** Controla si las CLI primitives (step, box, header, ...) deben renderizarse. */
56
56
  private _showPrimitives;
57
57
  private terminalBridge;
58
58
  /**
59
- * Active smart-preset reference (set by `preset()`). Typed as `unknown`
60
- * to keep the public surface clean; consumed by `createStyledOutput`.
59
+ * Referencia activa al smart-preset (fijada por `preset()`). Tipada como
60
+ * `unknown` para mantener limpia la surface pública; la consume
61
+ * `createStyledOutput`.
61
62
  */
62
63
  private _activePreset?;
63
64
  /**
64
- * Name of the active smart-preset. Stored separately so theme-change
65
- * detection can re-render without re-running the preset body.
65
+ * Nombre del smart-preset activo. Se guarda aparte para que la detección
66
+ * de cambio de tema pueda re-renderizar sin re-ejecutar el body del preset.
66
67
  */
67
68
  private _activePresetName?;
68
69
  /**
69
- * Last-applied `customize()` overrides. Stored for later read by
70
- * `createStyledOutput`.
70
+ * Overrides aplicados por el último `customize()`. Se conservan para que
71
+ * `createStyledOutput` los lea después.
71
72
  */
72
73
  private _customization?;
73
74
  /**
74
- * This logger's own context bindings (from child() calls).
75
- * Single source of truth for this logger's contribution to the context chain.
75
+ * Bindings propios de este logger (provenientes de llamadas a `child()`).
76
+ * Source of truth única de la contribución de este logger a la cadena de contexto.
76
77
  * @private
77
78
  */
78
79
  private _bindings;
79
80
  /**
80
- * Reference to the parent's merged context record at the time this logger
81
- * was created. Together with _bindings, forms the context chain.
82
- * Undefined for the root logger.
81
+ * Referencia al record de contexto mergueado del parent en el momento en
82
+ * que se creó este logger. Junto con `_bindings`, forma la cadena de
83
+ * contexto. `undefined` para el logger raíz.
83
84
  * @private
84
85
  */
85
86
  private _parentContextRecord;
@@ -178,86 +179,87 @@ export declare class Logger {
178
179
  */
179
180
  setBannerType(bannerType: BannerType): void;
180
181
  /**
181
- * Runs `fn` within an AsyncLocalStorage scope where `bindings` are
182
- * merged into the context for all log calls inside `fn`.
182
+ * Ejecuta `fn` dentro de un scope AsyncLocalStorage donde `bindings` se
183
+ * merguean al contexto para todas las llamadas de log dentro de `fn`.
183
184
  *
184
- * Without `fn` (the old setter shape): no-op for backwards compatibility.
185
- * Prefer `child()` for persistent bindings or `withContextAsync()` for
186
- * async callbacks.
185
+ * Sin `fn` (el shape legacy de setter): no-op por backwards compatibility.
186
+ * Preferir `child()` para bindings persistentes o `withContextAsync()`
187
+ * para callbacks async.
187
188
  *
188
- * @param bindings - Key-value pairs to attach for the duration of `fn`
189
- * @param fn - Optional synchronous function to run with scoped bindings
190
- * @returns The return value of `fn`, or undefined if no fn provided
189
+ * @param bindings - Pares key-value a adjuntar durante la ejecución de `fn`
190
+ * @param fn - Función sincrónica opcional a ejecutar con los bindings en scope
191
+ * @returns El valor de retorno de `fn`, o `undefined` si no se pasa `fn`
191
192
  *
192
193
  * @example
193
- * // Scoped synchronous callback
194
+ * // Callback sincrónico scoped
194
195
  * logger.withContext({ requestId: 'r-42' }, () => {
195
- * doWork(); // logs inside see requestId in attributes
196
+ * doWork(); // los logs de aquí ven requestId en attributes
196
197
  * });
197
198
  *
198
199
  * @example
199
- * // Persistent binding: use child()
200
+ * // Binding persistente: usar child()
200
201
  * const reqLog = logger.child({ requestId: 'r-42' });
201
- * reqLog.info('handling request'); // attributes include requestId
202
+ * reqLog.info('handling request'); // attributes incluye requestId
202
203
  *
203
- * @see {@link child} for an immutable copy with the merged context
204
- * @see {@link withContextAsync} for async callback variant
204
+ * @see {@link child} para una copia inmutable con el contexto mergueado
205
+ * @see {@link withContextAsync} para la variante con callback async
205
206
  */
206
207
  withContext<R>(bindings: Record<string, unknown>, fn?: () => R): R | undefined;
207
208
  /**
208
- * Async variant of `withContext`. Runs `fn` within an AsyncLocalStorage
209
- * scope so bindings are available to all async log calls inside `fn`.
209
+ * Variante async de `withContext`. Ejecuta `fn` dentro de un scope
210
+ * AsyncLocalStorage para que los bindings estén disponibles a todas las
211
+ * llamadas de log async dentro de `fn`.
210
212
  *
211
- * @param bindings - Key-value pairs to attach for the duration of `fn`
212
- * @param fn - Async function to run with the scoped bindings
213
- * @returns The return value of `fn`
213
+ * @param bindings - Pares key-value a adjuntar durante la ejecución de `fn`
214
+ * @param fn - Función async a ejecutar con los bindings en scope
215
+ * @returns El valor de retorno de `fn`
214
216
  *
215
217
  * @example
216
218
  * await logger.withContextAsync({ requestId: 'r-42' }, async () => {
217
- * await fetchData(); // logs inside see requestId in attributes
219
+ * await fetchData(); // los logs de aquí ven requestId en attributes
218
220
  * });
219
221
  *
220
- * @see {@link child} for a persistent child logger
221
- * @see {@link withContext} for synchronous callback variant
222
+ * @see {@link child} para un child logger persistente
223
+ * @see {@link withContext} para la variante con callback sincrónico
222
224
  */
223
225
  withContextAsync<R>(bindings: Record<string, unknown>, fn: () => Promise<R>): Promise<R>;
224
226
  /**
225
- * Returns an immutable copy of this logger with the extra context bound.
226
- * Future calls on the child emit with the merged context, without
227
- * mutating the parent — the canonical MDC pattern.
227
+ * Devuelve una copia inmutable de este logger con el contexto extra bound.
228
+ * Las llamadas futuras sobre el child emiten con el contexto mergueado,
229
+ * sin mutar al parent — el patrón canónico de MDC.
228
230
  *
229
- * @param extra - Key-value pairs to attach (requestId, userId, ...)
230
- * @returns A new Logger with merged context
231
+ * @param extra - Pares key-value a adjuntar (requestId, userId, ...)
232
+ * @returns Un nuevo Logger con el contexto mergueado
231
233
  *
232
234
  * @example
233
235
  * const reqLog = logger.child({ requestId: req.id });
234
- * reqLog.info('start'); // emits attributes: { requestId }
235
- * logger.info('unrelated'); // NOT affected — parent's context untouched
236
+ * reqLog.info('start'); // emite attributes: { requestId }
237
+ * logger.info('unrelated'); // NO afectado — el contexto del parent queda intacto
236
238
  *
237
239
  */
238
240
  child(extra: Record<string, unknown>): Logger;
239
241
  /**
240
- * Drops every key from the bound context. After this call, emitted
241
- * records no longer carry `attributes` until {@link withContext} or
242
- * {@link child} re-establish one.
242
+ * Descarta todas las keys del contexto bound. Tras esta llamada, los
243
+ * records emitidos dejan de llevar `attributes` hasta que
244
+ * {@link withContext} o {@link child} restablezcan uno.
243
245
  *
244
- * @returns The same logger instance, now context-free
246
+ * @returns La misma instancia del logger, ahora sin contexto
245
247
  */
246
248
  clearContext(): this;
247
249
  /**
248
- * Snapshot of the bound context. Returned object is a shallow copy:
249
- * mutating it does NOT affect what subsequent log calls emit.
250
+ * Snapshot del contexto bound. El objeto devuelto es una shallow copy:
251
+ * mutarlo NO afecta lo que emiten las llamadas de log posteriores.
250
252
  *
251
- * @returns A read-only snapshot of the current context
253
+ * @returns Un snapshot read-only del contexto actual
252
254
  */
253
255
  getContext(): Readonly<Record<string, unknown>>;
254
256
  /**
255
- * Updates the default OTel resource (service.name, version, env).
256
- * Persisted into every emitted record's `resource` field unless the
257
- * record itself overrides it.
257
+ * Actualiza el resource OTel por defecto (service.name, version, env).
258
+ * Se persiste en el campo `resource` de cada record emitido, salvo que
259
+ * el propio record lo override.
258
260
  *
259
- * @param resource - Partial OTel resource to merge into the current one
260
- * @returns The same logger instance, for chaining
261
+ * @param resource - Resource OTel parcial a merguear con el actual
262
+ * @returns La misma instancia del logger, para chaining
261
263
  *
262
264
  * @example
263
265
  * logger.setResource({ 'service.name': 'api', 'service.version': '1.2.3' });
@@ -274,20 +276,15 @@ export declare class Logger {
274
276
  */
275
277
  resetConfig(): void;
276
278
  /**
277
- * Método de limpieza para eliminar listeners y liberar recursos
279
+ * Método de limpieza para eliminar listeners y liberar recursos.
278
280
  *
279
- * @example
280
- * // Antes de cerrar la aplicación
281
- * logger.cleanup();
282
- *
283
- */
284
- /**
285
- * Tears down every resource held by this Logger. Safe to call multiple
286
- * times. Fixed in 5.1.0 to fully drain transports + clear timers +
287
- * drop the legacy handler list + reset group depth + clear context.
281
+ * Vacía los transports (drain), limpia timers, suelta la lista de
282
+ * handlers legacy, resetea el group depth y limpia el context.
283
+ * Seguro de invocar múltiples veces.
288
284
  *
289
285
  * @example
290
- * await logger.cleanup(); // before process exit / hot reload
286
+ * // Antes de cerrar la aplicación
287
+ * await logger.cleanup();
291
288
  *
292
289
  */
293
290
  cleanup(): Promise<void>;
@@ -303,7 +300,7 @@ export declare class Logger {
303
300
  * logger.preset('glassmorphism'); // Efectos de blur modernos
304
301
  * logger.preset('minimal'); // Minimalista y elegante
305
302
  * logger.preset('debug'); // Modo desarrollo detallado
306
- * logger.preset('production'); // Optimizado para producción
303
+ * logger.preset('production'); // Enfocado en producción
307
304
  *
308
305
  */
309
306
  preset(name: string): void;
@@ -407,8 +404,59 @@ export declare class Logger {
407
404
  *
408
405
  */
409
406
  clearBadges(): this;
407
+ /**
408
+ * Crea un logger scoped para un componente o módulo del dominio.
409
+ *
410
+ * El `ComponentLogger` resultante prepends un badge `[name]` a cada
411
+ * mensaje y comparte configuración, transports y hooks con el logger
412
+ * padre. Útil para trazar el origen de los logs en apps con muchos
413
+ * módulos (Auth, DB, Cache, ...).
414
+ *
415
+ * @param {string} name - Nombre del componente que aparecerá como badge
416
+ * @returns {ComponentLogger} Logger scoped para el componente
417
+ *
418
+ * @example
419
+ * const auth = logger.component('Auth');
420
+ * auth.info('Validando token'); // [Auth] Validando token
421
+ * auth.success('Token válido');
422
+ *
423
+ * @see {@link api} para loggers de endpoints REST/GraphQL
424
+ * @see {@link scope} para un scope genérico sin badge de componente
425
+ */
410
426
  component(name: string): ComponentLogger;
427
+ /**
428
+ * Crea un logger scoped para un endpoint o surface de API.
429
+ *
430
+ * Como `component()` pero con styling orientado a APIs (badge `[API]`
431
+ * por defecto más el nombre del sub-scope). Útil para distinguir
432
+ * tráfico REST vs GraphQL vs WebSocket en los logs.
433
+ *
434
+ * @param {string} name - Nombre de la API o surface (p.ej. `'REST'`, `'GraphQL'`)
435
+ * @returns {APILogger} Logger scoped para la API
436
+ *
437
+ * @example
438
+ * const rest = logger.api('REST');
439
+ * rest.info('GET /users/42'); // [API] [REST] GET /users/42
440
+ *
441
+ * @see {@link component} para loggers de componentes de dominio
442
+ */
411
443
  api(name: string): APILogger;
444
+ /**
445
+ * Crea un logger scoped genérico con un prefijo.
446
+ *
447
+ * Variante minimal de `component()` / `api()`: solo aplica un prefijo
448
+ * de scope sin badges ni styling especial. Útil para sub-módulos que
449
+ * no encajan en las categorías de `component`/`api`.
450
+ *
451
+ * @param {string} name - Texto del prefijo de scope
452
+ * @returns {ScopedLogger} Logger con el scope aplicado
453
+ *
454
+ * @example
455
+ * const db = logger.scope('db');
456
+ * db.info('Pool conectado'); // [db] Pool conectado
457
+ *
458
+ * @see {@link component} y {@link api} para variantes con badges
459
+ */
412
460
  scope(name: string): ScopedLogger;
413
461
  /**
414
462
  * Personalización simple con configuración mínima
@@ -600,14 +648,18 @@ export declare class Logger {
600
648
  */
601
649
  removeTransport(id: string): boolean;
602
650
  /**
603
- * Fuerza el flush de todos los transports
651
+ * Fuerza el flush de todos los transports. Antes de flushear, cierra los
652
+ * spans aún abiertos (`incomplete: true`) y los encola para export — un
653
+ * span abierto nunca se tira en un flush.
604
654
  *
605
655
  * @returns Promise que resuelve cuando todos los buffers están vaciados
606
656
  *
607
657
  */
608
658
  flushTransports(): Promise<void>;
609
659
  /**
610
- * Cierra todos los transports
660
+ * Cierra todos los transports. Como en {@link flushTransports}, primero
661
+ * fuerza el cierre de los spans abiertos para que viajen en el flush
662
+ * final del close.
611
663
  *
612
664
  * @returns Promise que resuelve cuando todos están cerrados
613
665
  *
@@ -627,37 +679,48 @@ export declare class Logger {
627
679
  */
628
680
  private shouldLog;
629
681
  /**
630
- * Builds and dispatches a `TransportRecord` to the {@link TransportManager}
631
- * (no-op if no transports are registered). Shared by every log path —
632
- * `log()`, `success()`, and visual methods like `table()` / `group()` /
633
- * `time()` — so all emissions hit the same transport pipeline.
682
+ * Tag pendiente de inyectar en el siguiente `TransportRecord` emitido
683
+ * por `log()`. Lo fijan `success()` y `logWithBindingsAndTag()` antes
684
+ * de delegar; `log()` lo consume y lo resetea a `undefined`.
634
685
  *
635
- * @param level - The canonical log level (trace/debug/info/warn/error/critical)
636
- * @param message - Final, post-hook message text
637
- * @param prefix - Effective prefix (global + scope)
638
- * @param stackInfo - Optional caller location
639
- * @param extra - Optional fields to merge into the record (e.g. `{ tag: 'success' }`)
686
+ * @internal
640
687
  */
641
688
  protected _dispatchTag: string | undefined;
642
689
  /**
643
- * Computes the fully-merged context for this logger.
690
+ * Computa el contexto completamente mergueado para este logger.
644
691
  *
645
- * The context chain is built at child-creation time: each child stores
646
- * its parent's fully-merged context (at that moment) as _parentContextRecord.
647
- * This means _parentContextRecord already contains all ancestors' bindings
648
- * in the correct precedence order (root first, nearest child last).
692
+ * La cadena de contexto se construye en el momento de crear el child:
693
+ * cada child almacena el contexto fully-merged de su parent (en ese
694
+ * instante) como `_parentContextRecord`. Esto implica que
695
+ * `_parentContextRecord` ya contiene los bindings de todos los ancestros
696
+ * en el orden de precedencia correcto (root primero, child más cercano al final).
649
697
  *
650
- * Merge order (later wins):
651
- * 1. _parentContextRecord — parent's merged context snapshot at creation time
652
- * 2. _bindings — this logger's own bindings (child() calls)
653
- * 3. ALS store — withContext/withContextAsync scope (highest priority)
698
+ * Orden de merge (gana el último):
699
+ * 1. _parentContextRecord — snapshot del contexto mergueado del parent en la creación
700
+ * 2. _bindings — bindings propios de este logger (llamadas a `child()`)
701
+ * 3. ALS store — scope de `withContext`/`withContextAsync` (prioridad máxima)
654
702
  *
655
703
  * @internal
656
- * @returns The merged context record
704
+ * @returns El record de contexto mergueado
657
705
  */
658
706
  private _getMergedContext;
659
- /** @internal Exposes base merged context (no ALS) to LogContext child factory closure. */
707
+ /** @internal Expone el contexto base mergueado (sin ALS) a la closure de la child factory de LogContext. */
660
708
  _captureMergedContext(): Record<string, unknown>;
709
+ /**
710
+ * Construye y despacha un `TransportRecord` al {@link TransportManager}
711
+ * (no-op si no hay transports registrados). Lo comparten todos los
712
+ * caminos de log — `log()`, `success()` y los métodos visuales como
713
+ * `table()` / `group()` / `time()` — para que toda emisión atraviese
714
+ * el mismo pipeline de transports.
715
+ *
716
+ * @protected
717
+ * @param {LogLevel} level - Nivel canónico (trace/debug/info/warn/error/critical)
718
+ * @param {string} message - Mensaje final, post-hook
719
+ * @param {string | undefined} prefix - Prefijo efectivo (global + scope)
720
+ * @param {StackInfo | null} stackInfo - Ubicación del caller, opcional
721
+ * @param {Partial<TransportRecord>} [extra] - Campos extra a mergear en el record
722
+ * (p.ej. `{ tag: 'success' }` o `attributes` adicionales)
723
+ */
661
724
  protected dispatchToTransports(level: LogLevel, message: string, prefix: string | undefined, stackInfo: StackInfo | null, extra?: Partial<TransportRecord>): void;
662
725
  /**
663
726
  * Obtiene el prefijo efectivo (global + scope)
@@ -666,50 +729,78 @@ export declare class Logger {
666
729
  */
667
730
  private getEffectivePrefix;
668
731
  /**
669
- * Método central de logging. Awaits the `beforeLog` hook pipeline
670
- * synchronously (so redactions / enrichments are reflected in the
671
- * emitted message before console + transport dispatch).
732
+ * Método central de logging. Espera el hook pipeline `beforeLog`
733
+ * antes de despachar a consola y transports, para que redacciones
734
+ * o enriquecimientos (PII, correlation IDs) se reflejen en el
735
+ * mensaje emitido.
736
+ *
737
+ * Los callers fire-and-forget (p.ej. `logger.info(...)` sin `await`)
738
+ * siguen funcionando: el `Promise<void>` resultante se descarta.
739
+ * Se recomienda `await` cuando los hooks `beforeLog` mutan `message`.
672
740
  *
673
- * Fire-and-forget callers (e.g. `logger.info(...)` without `await`)
674
- * still work — the resulting `Promise<void>` is dropped on the floor.
675
- * Awaiting is recommended when `beforeLog` hooks mutate `message`
676
- * (e.g. PII redaction, correlation IDs).
741
+ * El tag opcional (`TransportRecord.tag`) NO se pasa como argumento:
742
+ * se establece vía `_dispatchTag` (ver `success()` y
743
+ * {@link logWithBindingsAndTag}) antes de invocar este método.
677
744
  *
678
745
  * @protected
679
- * @param level - Nivel del log
680
- * @param args - Argumentos a loggear
681
- * @returns Promise that resolves once the record has been dispatched
746
+ * @param {LogLevel} level - Nivel del log
747
+ * @param {unknown[]} args - Argumentos a loggear (mensaje + datos)
748
+ * @returns {Promise<void>} Promesa que resuelve al completar el dispatch
682
749
  *
683
750
  */
751
+ protected log(level: LogLevel, ...args: unknown[]): Promise<void>;
684
752
  /**
685
- * Protected logging method. Awaits the `beforeLog` hook pipeline
686
- * synchronously (so redactions / enrichments are reflected in the
687
- * emitted message before console + transport dispatch).
753
+ * Emite un log aplicando bindings (badges, scope) al prefijo del
754
+ * mensaje antes de delegar en {@link Logger.log}.
688
755
  *
689
- * Fire-and-forget callers (e.g. `logger.info(...)` without `await`)
690
- * still work — the resulting `Promise<void>` is dropped on the floor.
691
- * Awaiting is recommended when `beforeLog` hooks mutate `message`
692
- * (e.g. PII redaction, correlation IDs).
756
+ * No es API pública de consumo: existe para que `ScopedLogger`
757
+ * (`component()` / `api()` / `scope()`) pueda reutilizar el pipeline
758
+ * central de `log()` sin duplicar la lógica de styling/badges.
693
759
  *
694
- * @protected
695
- * @param level - Nivel del log
696
- * @param args - Argumentos a loggear
697
- * @param tag - Optional tag forwarded to `dispatchToTransports` as
698
- * `TransportRecord.tag` (e.g. `'success'` for success records).
699
- * @returns Promise that resolves once the record has been dispatched
760
+ * @internal
761
+ * @param {Bindings} bindings - Bindings de scope (badges, scope name, ...)
762
+ * @param {LogLevel} level - Nivel de log
763
+ * @param {unknown[]} args - Argumentos a loggear
764
+ * @returns {Promise<void>} Promesa del dispatch
700
765
  *
766
+ * @see {@link logWithBindingsAndTag} para la variante con `tag`
701
767
  */
702
- protected log(level: LogLevel, ...args: unknown[]): Promise<void>;
703
768
  logWithBindings(bindings: Bindings, level: LogLevel, ...args: unknown[]): Promise<void>;
704
769
  /**
705
- * Like `logWithBindings()` but sets _dispatchTag first so that
706
- * `log()` dispatches with the tag. Used by ScopedLogger.success()
707
- * to propagate tag:'success' through the normal log() pipeline.
770
+ * Como {@link logWithBindings} pero fija `_dispatchTag` antes de
771
+ * delegar, para que `log()` despache el `TransportRecord` con el
772
+ * tag indicado. Lo usa `ScopedLogger.success()` para propagar
773
+ * `tag: 'success'` a través del pipeline normal de `log()`.
774
+ *
775
+ * @internal
776
+ * @param {Bindings} bindings - Bindings de scope (badges, scope name, ...)
777
+ * @param {LogLevel} level - Nivel de log
778
+ * @param {LogTag} tag - Tag a inyectar en el `TransportRecord`
779
+ * @param {unknown[]} args - Argumentos a loggear
780
+ * @returns {Promise<void>} Promesa del dispatch
708
781
  */
709
782
  logWithBindingsAndTag(bindings: Bindings, level: LogLevel, tag: LogTag, ...args: unknown[]): Promise<void>;
783
+ /**
784
+ * Registra mensajes de debug (nivel más verboso junto a `trace`).
785
+ * Pensado para diagnóstico de desarrollo: valores intermedios, flags
786
+ * de control flow, estado interno. Devuelve `Promise<void>`.
787
+ *
788
+ * Filtrado por defecto cuando `verbosity > 'debug'` (ver `setVerbosity`).
789
+ *
790
+ * @param {unknown[]} args - Mensaje + datos a inspeccionar
791
+ * @returns {Promise<void>} Promesa del dispatch
792
+ *
793
+ * @example
794
+ * logger.debug('Estado interno:', { conn, queueSize });
795
+ * logger.debug('Entrando en branch X');
796
+ *
797
+ * @see {@link trace} para diagnósticos aún más granulares
798
+ * @see {@link setVerbosity} para controlar el nivel mínimo visible
799
+ */
710
800
  debug(...args: unknown[]): Promise<void>;
711
801
  /**
712
- * Registra mensajes informativos. Devuelve `Promise<void>` desde 5.1.0.
802
+ * Registra mensajes informativos. El `await` retorna cuando el hook
803
+ * `beforeLog` y el dispatch a transports han terminado.
713
804
  *
714
805
  * @param args - Mensajes y datos informativos
715
806
  *
@@ -720,14 +811,14 @@ export declare class Logger {
720
811
  */
721
812
  info(...args: unknown[]): Promise<void>;
722
813
  /**
723
- * Registra mensajes de advertencia. Devuelve `Promise<void>` desde 5.1.0.
814
+ * Registra mensajes de advertencia.
724
815
  *
725
816
  * @param args - Mensajes de advertencia
726
817
  *
727
818
  */
728
819
  warn(...args: unknown[]): Promise<void>;
729
820
  /**
730
- * Registra mensajes de error. Devuelve `Promise<void>` desde 5.1.0.
821
+ * Registra mensajes de error.
731
822
  *
732
823
  * @param args - Mensaje de error y stack traces
733
824
  *
@@ -760,7 +851,7 @@ export declare class Logger {
760
851
  */
761
852
  trace(...args: unknown[]): void;
762
853
  /**
763
- * Registra errores críticos (prioridad más alta). Devuelve `Promise<void>` desde 5.1.0.
854
+ * Registra errores críticos (prioridad más alta).
764
855
  *
765
856
  * @param args - Errores críticos del sistema
766
857
  *
@@ -769,6 +860,98 @@ export declare class Logger {
769
860
  *
770
861
  */
771
862
  critical(...args: unknown[]): Promise<void>;
863
+ /**
864
+ * Emite un **point-span**: un span con `start = end` para completion
865
+ * signals y eventos puntuales (una operación instantánea, un hito).
866
+ * No registra contexto activo ni puede leakear — se exporta de inmediato.
867
+ *
868
+ * El nombre `event` (y no `trace`) es deliberado: `trace` es un log level
869
+ * (el -1) y está reservado.
870
+ *
871
+ * @param {string} name - Nombre del evento (`job.completed`, `cache.flushed`, ...).
872
+ * @param {SpanAttributes} [attributes] - Attributes del span.
873
+ *
874
+ * @example
875
+ * logger.event('build.finished', { status: 'ok', durationMs: 4200 });
876
+ *
877
+ * @see {@link span} para intervalos con work-block
878
+ * @see {@link startSpan} para intervalos externally-ended
879
+ */
880
+ event(name: string, attributes?: SpanAttributes): void;
881
+ /**
882
+ * Ejecuta `fn` dentro de un span de intervalo. El span queda **activo en
883
+ * el AsyncLocalStorage del módulo** mientras `fn` corre: los logs emitidos
884
+ * dentro heredan su `traceId`/`spanId`, y los spans hijos lo toman como
885
+ * `parentSpanId`.
886
+ *
887
+ * Al retornar `fn` el span se cierra automáticamente; si `fn` lanza, se
888
+ * marca `status {code: 2}` con el mensaje del error (`fail`) y la
889
+ * excepción se relanza intacta.
890
+ *
891
+ * @typeParam T - Tipo resuelto por `fn`.
892
+ * @param {string} name - Nombre de la operación.
893
+ * @param {(s: Span) => T | Promise<T>} fn - Work-block a medir.
894
+ * @returns {Promise<T>} Lo que resuelve `fn`.
895
+ * @throws {unknown} Relanza cualquier error de `fn` tras marcar el span fallido.
896
+ *
897
+ * @example
898
+ * await logger.span('db.migrate', { target: 'v2' }, async (s) => {
899
+ * await runMigrations();
900
+ * s.set('tables', 14);
901
+ * });
902
+ *
903
+ * @see {@link event} para point-spans
904
+ * @see {@link startSpan} para spans externally-ended (poll/callback)
905
+ */
906
+ span<T>(name: string, fn: (s: Span) => T | Promise<T>): Promise<T>;
907
+ span<T>(name: string, attributes: SpanAttributes, fn: (s: Span) => T | Promise<T>): Promise<T>;
908
+ /**
909
+ * Inicia un span de intervalo **externally-ended**: devuelve el handle y
910
+ * NO fija contexto ALS (el cierre ocurre fuera del bloque léxico — p.ej.
911
+ * un `cli.spawn` que se cierra desde un poll o callback externo).
912
+ *
913
+ * Si el span no se cierra antes de `flushTransports()` / shutdown, el
914
+ * flush lo fuerza a cerrar con `incomplete: true` y lo exporta — nunca
915
+ * se tira.
916
+ *
917
+ * @param {string} name - Nombre de la operación.
918
+ * @param {SpanAttributes} [attributes] - Attributes iniciales.
919
+ * @returns {Span} Handle con `set`/`end`/`fail` y los ids del span.
920
+ *
921
+ * @example
922
+ * const s = logger.startSpan('spawn.build', { cmd: 'make' });
923
+ * proc.on('exit', code => {
924
+ * if (code === 0) s.end({ exitCode: code });
925
+ * else s.fail(new Error(`exit ${code}`));
926
+ * });
927
+ *
928
+ * @see {@link span} para el caso con work-block
929
+ */
930
+ startSpan(name: string, attributes?: SpanAttributes): Span;
931
+ /**
932
+ * Scope por defecto de los spans emitidos por este logger (el
933
+ * `globalPrefix`, o `'root'`).
934
+ * @internal
935
+ */
936
+ _spanScopeName(): string;
937
+ /**
938
+ * Emite un point-span con scope explícito. Lo consume
939
+ * {@link ScopedLogger.event}, que pasa su scope compuesto.
940
+ * @internal
941
+ */
942
+ _emitSpanEvent(name: string, attributes: SpanAttributes | undefined, scope: string): void;
943
+ /**
944
+ * Crea un span externally-ended con scope explícito. Lo consume
945
+ * {@link ScopedLogger.startSpan}.
946
+ * @internal
947
+ */
948
+ _startSpan(name: string, attributes: SpanAttributes | undefined, scope: string): Span;
949
+ /**
950
+ * Corre `fn` dentro de un span activo en el ALS con scope explícito.
951
+ * Lo consume {@link ScopedLogger.span}.
952
+ * @internal
953
+ */
954
+ _runSpan<T>(name: string, attributes: SpanAttributes | undefined, scope: string, fn: (s: Span) => T | Promise<T>): Promise<T>;
772
955
  /**
773
956
  * Muestra datos en formato de tabla. Pasa por la pipeline completa
774
957
  * (outputMode-respecting writeOutput + transports + hooks).
@@ -824,7 +1007,7 @@ export declare class Logger {
824
1007
  * Finaliza un temporizador y muestra el tiempo transcurrido
825
1008
  *
826
1009
  * @param {string} label - Etiqueta del temporizador a finalizar
827
- * @returns {number} Elapsed milliseconds, or -1 if timer not found
1010
+ * @returns {number} Milisegundos transcurridos, o `-1` si no se encuentra el timer
828
1011
  *
829
1012
  * @example
830
1013
  * logger.time('consulta-db');
@@ -877,11 +1060,11 @@ export declare class Logger {
877
1060
  */
878
1061
  logAnimated(message: string, duration?: number): void;
879
1062
  /**
880
- * Displays a step progress indicator in the terminal
1063
+ * Muestra un indicador de progreso de pasos en la terminal
881
1064
  *
882
- * @param {number} current - Current step number
883
- * @param {number} total - Total number of steps
884
- * @param {string} message - Step description
1065
+ * @param {number} current - Número de paso actual
1066
+ * @param {number} total - Número total de pasos
1067
+ * @param {string} message - Descripción del paso
885
1068
  *
886
1069
  * @example
887
1070
  * logger.step(1, 5, 'Analyzing repository...');
@@ -890,10 +1073,10 @@ export declare class Logger {
890
1073
  */
891
1074
  step(current: number, total: number, message: string): void;
892
1075
  /**
893
- * Displays a styled header with optional subtitle
1076
+ * Muestra un header con estilo y subtítulo opcional
894
1077
  *
895
- * @param {string} title - Main title text
896
- * @param {string} subtitle - Optional subtitle (rendered dimmed)
1078
+ * @param {string} title - Texto del título principal
1079
+ * @param {string} subtitle - Subtítulo opcional (se renderiza atenuado)
897
1080
  *
898
1081
  * @example
899
1082
  * logger.header('Commit Wizard', 'v2.0.0');
@@ -901,7 +1084,7 @@ export declare class Logger {
901
1084
  */
902
1085
  header(title: string, subtitle?: string): void;
903
1086
  /**
904
- * Displays a horizontal divider line
1087
+ * Muestra una línea divisoria horizontal
905
1088
  *
906
1089
  * @example
907
1090
  * logger.divider();
@@ -909,7 +1092,7 @@ export declare class Logger {
909
1092
  */
910
1093
  divider(): void;
911
1094
  /**
912
- * Outputs a blank line
1095
+ * Emite una línea en blanco
913
1096
  *
914
1097
  * @example
915
1098
  * logger.blank();
@@ -917,10 +1100,10 @@ export declare class Logger {
917
1100
  */
918
1101
  blank(): void;
919
1102
  /**
920
- * Renders content inside a bordered box
1103
+ * Renderiza contenido dentro de un box con borde
921
1104
  *
922
- * @param {string} content - Content string (may contain newlines)
923
- * @param {IBoxOptions} options - Box rendering options
1105
+ * @param {string} content - String de contenido (puede contener newlines)
1106
+ * @param {IBoxOptions} options - Opciones de renderizado del box
924
1107
  *
925
1108
  * @example
926
1109
  * logger.box('3 commits generated\nProvider: Groq', { title: 'Done', borderColor: '#00ff00' });
@@ -928,11 +1111,11 @@ export declare class Logger {
928
1111
  */
929
1112
  box(content: string, options?: IBoxOptions): void;
930
1113
  /**
931
- * Renders an array of objects as a formatted ASCII table.
932
- * Note: This is distinct from the existing table() method which uses console.table.
1114
+ * Renderiza un array de objetos como una tabla ASCII formateada.
1115
+ * Distinto del método `table()` existente, que usa `console.table`.
933
1116
  *
934
- * @param {Record<string, unknown>[]} rows - Array of row objects
935
- * @param {ITableOptions} options - Table rendering options
1117
+ * @param {Record<string, unknown>[]} rows - Array de objetos fila
1118
+ * @param {ITableOptions} options - Opciones de renderizado de la tabla
936
1119
  *
937
1120
  * @example
938
1121
  * logger.cliTable([
@@ -943,11 +1126,11 @@ export declare class Logger {
943
1126
  */
944
1127
  cliTable(rows: Record<string, unknown>[], options?: ITableOptions): void;
945
1128
  /**
946
- * Creates a spinner handle for showing progress during async operations.
947
- * Returns a NoopSpinner in non-TTY environments.
1129
+ * Crea un handle de spinner para mostrar progreso durante operaciones async.
1130
+ * Devuelve un `NoopSpinner` en entornos non-TTY.
948
1131
  *
949
- * @param {string} message - Initial spinner text
950
- * @returns {ISpinnerHandle} Spinner controller
1132
+ * @param {string} message - Texto inicial del spinner
1133
+ * @returns {ISpinnerHandle} Controller del spinner
951
1134
  *
952
1135
  * @example
953
1136
  * const s = logger.spinner('Analyzing repository...');
@@ -958,30 +1141,31 @@ export declare class Logger {
958
1141
  */
959
1142
  spinner(message: string): ISpinnerHandle;
960
1143
  /**
961
- * Sets the CLI verbosity level, controlling both log verbosity and primitive visibility
1144
+ * Fija el nivel de verbosidad del CLI, controlando a la vez la verbosidad
1145
+ * de logs y la visibilidad de las primitives
962
1146
  *
963
- * @param {CLILogLevel} level - CLI log level
1147
+ * @param {CLILogLevel} level - Nivel de log del CLI
964
1148
  *
965
1149
  * @example
966
- * logger.setCLILevel('quiet'); // Only errors, no CLI primitives
967
- * logger.setCLILevel('verbose'); // Debug logs + all CLI primitives
1150
+ * logger.setCLILevel('quiet'); // Solo errors, sin CLI primitives
1151
+ * logger.setCLILevel('verbose'); // Debug logs + todas las CLI primitives
968
1152
  *
969
1153
  */
970
1154
  setCLILevel(level: CLILogLevel): void;
971
1155
  /**
972
- * Returns the current CLI log level
973
- * @returns {CLILogLevel} Current CLI log level
1156
+ * Devuelve el nivel de log del CLI actual
1157
+ * @returns {CLILogLevel} Nivel de log del CLI actual
974
1158
  */
975
1159
  get cliLevel(): CLILogLevel;
976
1160
  /**
977
- * Writes formatted output to the configured destination.
978
- * Respects outputMode configuration for console, silent, or custom output.
1161
+ * Escribe output formateado al destino configurado.
1162
+ * Respeta la configuración `outputMode` para output a consola, silencioso o custom.
979
1163
  *
980
1164
  * @private
981
- * @param {string} message - Formatted log message
982
- * @param {LogLevel} level - Log level
983
- * @param {string[]} styles - CSS styles for browser console
984
- * @param {unknown[]} additionalArgs - Additional arguments to log
1165
+ * @param {string} message - Mensaje de log formateado
1166
+ * @param {LogLevel} level - Nivel de log
1167
+ * @param {string[]} styles - Estilos CSS para la consola del navegador
1168
+ * @param {unknown[]} additionalArgs - Argumentos adicionales a loggear
985
1169
  */
986
1170
  private writeOutput;
987
1171
  /**
@@ -1005,15 +1189,16 @@ export declare class Logger {
1005
1189
  cli(command: string): Promise<void>;
1006
1190
  }
1007
1191
  /**
1008
- * Resets the default singleton. Clears the cached instance so the next call
1009
- * to `getDefaultLogger()` rebuilds it from defaults. Useful for tests and
1010
- * hot reload scenarios.
1192
+ * Resetea el singleton por defecto. Limpia la instancia cacheada para que la
1193
+ * próxima llamada a `getDefaultLogger()` la reconstruya desde defaults. Útil
1194
+ * para tests y escenarios de hot reload.
1011
1195
  *
1012
1196
  */
1013
1197
  export declare function resetDefaultLogger(): void;
1014
1198
  /**
1015
1199
  * Lazy default export — every property access defers to `getDefaultLogger()`.
1016
- * Side-effect-free at module import (BUG-N11).
1200
+ * Sin side-effects al importar el módulo (la primera llamada al singleton
1201
+ * se produce en el primer acceso a una propiedad, no en el `import`).
1017
1202
  *
1018
1203
  * @example
1019
1204
  * import logger from 'better-logger';
@@ -1021,6 +1206,16 @@ export declare function resetDefaultLogger(): void;
1021
1206
  */
1022
1207
  declare const loggerProxy: Logger;
1023
1208
  export default loggerProxy;
1209
+ /**
1210
+ * Resuelve los argumentos del overload `span(name, fn?)` /
1211
+ * `span(name, attributes, fn)` a `{ attributes, fn }`.
1212
+ *
1213
+ * @internal Compartido con `ScopedLogger.span`; no es API pública.
1214
+ */
1215
+ export declare function resolveSpanArgs<T>(fnOrAttributes: ((s: Span) => T | Promise<T>) | SpanAttributes, maybeFn?: (s: Span) => T | Promise<T>): {
1216
+ attributes: SpanAttributes | undefined;
1217
+ fn: (s: Span) => T | Promise<T>;
1218
+ };
1024
1219
  /**
1025
1220
  * Métodos individuales exportados para conveniencia
1026
1221
  * @description Todos los métodos están correctamente enlazados al singleton lazy
@@ -1037,6 +1232,10 @@ export declare const group: (label: string, collapsed?: boolean) => void;
1037
1232
  export declare const groupEnd: () => void;
1038
1233
  export declare const time: (label: string) => void;
1039
1234
  export declare const timeEnd: (label: string) => number;
1235
+ export declare const event: (name: string, attributes?: SpanAttributes) => void;
1236
+ export declare const startSpan: (name: string, attributes?: SpanAttributes) => Span;
1237
+ export declare function span<T>(name: string, fn: (s: Span) => T | Promise<T>): Promise<T>;
1238
+ export declare function span<T>(name: string, attributes: SpanAttributes, fn: (s: Span) => T | Promise<T>): Promise<T>;
1040
1239
  export declare const setGlobalPrefix: (prefix: string) => void;
1041
1240
  export declare const setVerbosity: (level: Verbosity) => void;
1042
1241
  export declare const addHandler: (handler: ILogHandler) => void;