@logtape/logtape 0.11.0 → 0.12.0-dev.181

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 (171) hide show
  1. package/config.test.ts +591 -0
  2. package/config.ts +421 -0
  3. package/context.test.ts +187 -0
  4. package/context.ts +55 -0
  5. package/deno.json +36 -0
  6. package/dist/_virtual/rolldown_runtime.cjs +30 -0
  7. package/dist/config.cjs +247 -0
  8. package/dist/config.d.cts +189 -0
  9. package/dist/config.d.cts.map +1 -0
  10. package/dist/config.d.ts +189 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/config.js +241 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/context.cjs +30 -0
  15. package/dist/context.d.cts +39 -0
  16. package/dist/context.d.cts.map +1 -0
  17. package/dist/context.d.ts +39 -0
  18. package/dist/context.d.ts.map +1 -0
  19. package/dist/context.js +31 -0
  20. package/dist/context.js.map +1 -0
  21. package/dist/filter.cjs +32 -0
  22. package/dist/filter.d.cts +37 -0
  23. package/dist/filter.d.cts.map +1 -0
  24. package/{types → dist}/filter.d.ts +12 -6
  25. package/dist/filter.d.ts.map +1 -0
  26. package/dist/filter.js +31 -0
  27. package/dist/filter.js.map +1 -0
  28. package/dist/formatter.cjs +281 -0
  29. package/dist/formatter.d.cts +338 -0
  30. package/dist/formatter.d.cts.map +1 -0
  31. package/dist/formatter.d.ts +338 -0
  32. package/dist/formatter.d.ts.map +1 -0
  33. package/dist/formatter.js +275 -0
  34. package/dist/formatter.js.map +1 -0
  35. package/dist/level.cjs +64 -0
  36. package/dist/level.d.cts +34 -0
  37. package/dist/level.d.cts.map +1 -0
  38. package/{types → dist}/level.d.ts +7 -5
  39. package/dist/level.d.ts.map +1 -0
  40. package/dist/level.js +62 -0
  41. package/dist/level.js.map +1 -0
  42. package/dist/logger.cjs +351 -0
  43. package/dist/logger.d.cts +501 -0
  44. package/dist/logger.d.cts.map +1 -0
  45. package/dist/logger.d.ts +501 -0
  46. package/dist/logger.d.ts.map +1 -0
  47. package/dist/logger.js +351 -0
  48. package/dist/logger.js.map +1 -0
  49. package/dist/mod.cjs +33 -0
  50. package/dist/mod.d.cts +9 -0
  51. package/dist/mod.d.ts +9 -0
  52. package/dist/mod.js +9 -0
  53. package/dist/record.d.cts +50 -0
  54. package/dist/record.d.cts.map +1 -0
  55. package/dist/record.d.ts +50 -0
  56. package/dist/record.d.ts.map +1 -0
  57. package/dist/sink.cjs +95 -0
  58. package/dist/sink.d.cts +112 -0
  59. package/dist/sink.d.cts.map +1 -0
  60. package/{types → dist}/sink.d.ts +49 -45
  61. package/dist/sink.d.ts.map +1 -0
  62. package/dist/sink.js +94 -0
  63. package/dist/sink.js.map +1 -0
  64. package/dist/util.cjs +9 -0
  65. package/dist/util.d.cts +12 -0
  66. package/dist/util.d.cts.map +1 -0
  67. package/dist/util.d.ts +12 -0
  68. package/dist/util.d.ts.map +1 -0
  69. package/dist/util.deno.cjs +16 -0
  70. package/dist/util.deno.d.cts +12 -0
  71. package/dist/util.deno.d.cts.map +1 -0
  72. package/dist/util.deno.d.ts +12 -0
  73. package/dist/util.deno.d.ts.map +1 -0
  74. package/dist/util.deno.js +16 -0
  75. package/dist/util.deno.js.map +1 -0
  76. package/dist/util.js +9 -0
  77. package/dist/util.js.map +1 -0
  78. package/dist/util.node.cjs +10 -0
  79. package/dist/util.node.d.cts +12 -0
  80. package/dist/util.node.d.cts.map +1 -0
  81. package/dist/util.node.d.ts +12 -0
  82. package/dist/util.node.d.ts.map +1 -0
  83. package/dist/util.node.js +10 -0
  84. package/dist/util.node.js.map +1 -0
  85. package/filter.test.ts +70 -0
  86. package/filter.ts +57 -0
  87. package/fixtures.ts +30 -0
  88. package/formatter.test.ts +530 -0
  89. package/formatter.ts +724 -0
  90. package/level.test.ts +47 -0
  91. package/level.ts +67 -0
  92. package/logger.test.ts +823 -0
  93. package/logger.ts +1124 -0
  94. package/mod.ts +54 -0
  95. package/package.json +35 -23
  96. package/record.ts +49 -0
  97. package/sink.test.ts +219 -0
  98. package/sink.ts +167 -0
  99. package/tsdown.config.ts +24 -0
  100. package/util.deno.ts +19 -0
  101. package/util.node.ts +12 -0
  102. package/util.ts +11 -0
  103. package/esm/_dnt.shims.js +0 -57
  104. package/esm/config.js +0 -297
  105. package/esm/context.js +0 -23
  106. package/esm/filter.js +0 -42
  107. package/esm/formatter.js +0 -370
  108. package/esm/level.js +0 -59
  109. package/esm/logger.js +0 -517
  110. package/esm/mod.js +0 -8
  111. package/esm/nodeUtil.cjs +0 -20
  112. package/esm/nodeUtil.js +0 -2
  113. package/esm/package.json +0 -3
  114. package/esm/record.js +0 -1
  115. package/esm/sink.js +0 -96
  116. package/script/_dnt.shims.js +0 -60
  117. package/script/config.js +0 -331
  118. package/script/context.js +0 -26
  119. package/script/filter.js +0 -46
  120. package/script/formatter.js +0 -380
  121. package/script/level.js +0 -64
  122. package/script/logger.js +0 -548
  123. package/script/mod.js +0 -36
  124. package/script/nodeUtil.js +0 -20
  125. package/script/package.json +0 -3
  126. package/script/record.js +0 -2
  127. package/script/sink.js +0 -101
  128. package/types/_dnt.shims.d.ts +0 -2
  129. package/types/_dnt.shims.d.ts.map +0 -1
  130. package/types/_dnt.test_shims.d.ts.map +0 -1
  131. package/types/config.d.ts +0 -183
  132. package/types/config.d.ts.map +0 -1
  133. package/types/config.test.d.ts.map +0 -1
  134. package/types/context.d.ts +0 -35
  135. package/types/context.d.ts.map +0 -1
  136. package/types/context.test.d.ts.map +0 -1
  137. package/types/deps/jsr.io/@std/assert/0.222.1/_constants.d.ts.map +0 -1
  138. package/types/deps/jsr.io/@std/assert/0.222.1/_diff.d.ts.map +0 -1
  139. package/types/deps/jsr.io/@std/assert/0.222.1/_format.d.ts.map +0 -1
  140. package/types/deps/jsr.io/@std/assert/0.222.1/assert.d.ts.map +0 -1
  141. package/types/deps/jsr.io/@std/assert/0.222.1/assert_equals.d.ts.map +0 -1
  142. package/types/deps/jsr.io/@std/assert/0.222.1/assert_false.d.ts.map +0 -1
  143. package/types/deps/jsr.io/@std/assert/0.222.1/assert_greater_or_equal.d.ts.map +0 -1
  144. package/types/deps/jsr.io/@std/assert/0.222.1/assert_is_error.d.ts.map +0 -1
  145. package/types/deps/jsr.io/@std/assert/0.222.1/assert_less_or_equal.d.ts.map +0 -1
  146. package/types/deps/jsr.io/@std/assert/0.222.1/assert_rejects.d.ts.map +0 -1
  147. package/types/deps/jsr.io/@std/assert/0.222.1/assert_strict_equals.d.ts.map +0 -1
  148. package/types/deps/jsr.io/@std/assert/0.222.1/assert_throws.d.ts.map +0 -1
  149. package/types/deps/jsr.io/@std/assert/0.222.1/assertion_error.d.ts.map +0 -1
  150. package/types/deps/jsr.io/@std/assert/0.222.1/equal.d.ts.map +0 -1
  151. package/types/deps/jsr.io/@std/async/0.222.1/delay.d.ts.map +0 -1
  152. package/types/deps/jsr.io/@std/fmt/0.222.1/colors.d.ts.map +0 -1
  153. package/types/filter.d.ts.map +0 -1
  154. package/types/filter.test.d.ts.map +0 -1
  155. package/types/fixtures.d.ts.map +0 -1
  156. package/types/formatter.d.ts +0 -332
  157. package/types/formatter.d.ts.map +0 -1
  158. package/types/formatter.test.d.ts.map +0 -1
  159. package/types/level.d.ts.map +0 -1
  160. package/types/level.test.d.ts.map +0 -1
  161. package/types/logger.d.ts +0 -573
  162. package/types/logger.d.ts.map +0 -1
  163. package/types/logger.test.d.ts.map +0 -1
  164. package/types/mod.d.ts +0 -9
  165. package/types/mod.d.ts.map +0 -1
  166. package/types/nodeUtil.d.ts +0 -12
  167. package/types/nodeUtil.d.ts.map +0 -1
  168. package/types/record.d.ts +0 -44
  169. package/types/record.d.ts.map +0 -1
  170. package/types/sink.d.ts.map +0 -1
  171. package/types/sink.test.d.ts.map +0 -1
package/types/logger.d.ts DELETED
@@ -1,573 +0,0 @@
1
- import type { ContextLocalStorage } from "./context.js";
2
- import type { Filter } from "./filter.js";
3
- import { type LogLevel } from "./level.js";
4
- import type { LogRecord } from "./record.js";
5
- import type { Sink } from "./sink.js";
6
- /**
7
- * A logger interface. It provides methods to log messages at different
8
- * severity levels.
9
- *
10
- * ```typescript
11
- * const logger = getLogger("category");
12
- * logger.debug `A debug message with ${value}.`;
13
- * logger.info `An info message with ${value}.`;
14
- * logger.warn `A warning message with ${value}.`;
15
- * logger.error `An error message with ${value}.`;
16
- * logger.fatal `A fatal error message with ${value}.`;
17
- * ```
18
- */
19
- export interface Logger {
20
- /**
21
- * The category of the logger. It is an array of strings.
22
- */
23
- readonly category: readonly string[];
24
- /**
25
- * The logger with the supercategory of the current logger. If the current
26
- * logger is the root logger, this is `null`.
27
- */
28
- readonly parent: Logger | null;
29
- /**
30
- * Get a child logger with the given subcategory.
31
- *
32
- * ```typescript
33
- * const logger = getLogger("category");
34
- * const subLogger = logger.getChild("sub-category");
35
- * ```
36
- *
37
- * The above code is equivalent to:
38
- *
39
- * ```typescript
40
- * const logger = getLogger("category");
41
- * const subLogger = getLogger(["category", "sub-category"]);
42
- * ```
43
- *
44
- * @param subcategory The subcategory.
45
- * @returns The child logger.
46
- */
47
- getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
48
- /**
49
- * Get a logger with contextual properties. This is useful for
50
- * log multiple messages with the shared set of properties.
51
- *
52
- * ```typescript
53
- * const logger = getLogger("category");
54
- * const ctx = logger.with({ foo: 123, bar: "abc" });
55
- * ctx.info("A message with {foo} and {bar}.");
56
- * ctx.warn("Another message with {foo}, {bar}, and {baz}.", { baz: true });
57
- * ```
58
- *
59
- * The above code is equivalent to:
60
- *
61
- * ```typescript
62
- * const logger = getLogger("category");
63
- * logger.info("A message with {foo} and {bar}.", { foo: 123, bar: "abc" });
64
- * logger.warn(
65
- * "Another message with {foo}, {bar}, and {baz}.",
66
- * { foo: 123, bar: "abc", baz: true },
67
- * );
68
- * ```
69
- *
70
- * @param properties
71
- * @returns
72
- * @since 0.5.0
73
- */
74
- with(properties: Record<string, unknown>): Logger;
75
- /**
76
- * Log a debug message. Use this as a template string prefix.
77
- *
78
- * ```typescript
79
- * logger.debug `A debug message with ${value}.`;
80
- * ```
81
- *
82
- * @param message The message template strings array.
83
- * @param values The message template values.
84
- */
85
- debug(message: TemplateStringsArray, ...values: readonly unknown[]): void;
86
- /**
87
- * Log a debug message with properties.
88
- *
89
- * ```typescript
90
- * logger.debug('A debug message with {value}.', { value });
91
- * ```
92
- *
93
- * If the properties are expensive to compute, you can pass a callback that
94
- * returns the properties:
95
- *
96
- * ```typescript
97
- * logger.debug(
98
- * 'A debug message with {value}.',
99
- * () => ({ value: expensiveComputation() })
100
- * );
101
- * ```
102
- *
103
- * @param message The message template. Placeholders to be replaced with
104
- * `values` are indicated by keys in curly braces (e.g.,
105
- * `{value}`).
106
- * @param properties The values to replace placeholders with. For lazy
107
- * evaluation, this can be a callback that returns the
108
- * properties.
109
- */
110
- debug(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
111
- /**
112
- * Log a debug values with no message. This is useful when you
113
- * want to log properties without a message, e.g., when you want to log
114
- * the context of a request or an operation.
115
- *
116
- * ```typescript
117
- * logger.debug({ method: 'GET', url: '/api/v1/resource' });
118
- * ```
119
- *
120
- * Note that this is a shorthand for:
121
- *
122
- * ```typescript
123
- * logger.debug('{*}', { method: 'GET', url: '/api/v1/resource' });
124
- * ```
125
- *
126
- * If the properties are expensive to compute, you cannot use this shorthand
127
- * and should use the following syntax instead:
128
- *
129
- * ```typescript
130
- * logger.debug('{*}', () => ({
131
- * method: expensiveMethod(),
132
- * url: expensiveUrl(),
133
- * }));
134
- * ```
135
- *
136
- * @param properties The values to log. Note that this does not take
137
- * a callback.
138
- * @since 0.11.0
139
- */
140
- debug(properties: Record<string, unknown>): void;
141
- /**
142
- * Lazily log a debug message. Use this when the message values are expensive
143
- * to compute and should only be computed if the message is actually logged.
144
- *
145
- * ```typescript
146
- * logger.debug(l => l`A debug message with ${expensiveValue()}.`);
147
- * ```
148
- *
149
- * @param callback A callback that returns the message template prefix.
150
- * @throws {TypeError} If no log record was made inside the callback.
151
- */
152
- debug(callback: LogCallback): void;
153
- /**
154
- * Log an informational message. Use this as a template string prefix.
155
- *
156
- * ```typescript
157
- * logger.info `An info message with ${value}.`;
158
- * ```
159
- *
160
- * @param message The message template strings array.
161
- * @param values The message template values.
162
- */
163
- info(message: TemplateStringsArray, ...values: readonly unknown[]): void;
164
- /**
165
- * Log an informational message with properties.
166
- *
167
- * ```typescript
168
- * logger.info('An info message with {value}.', { value });
169
- * ```
170
- *
171
- * If the properties are expensive to compute, you can pass a callback that
172
- * returns the properties:
173
- *
174
- * ```typescript
175
- * logger.info(
176
- * 'An info message with {value}.',
177
- * () => ({ value: expensiveComputation() })
178
- * );
179
- * ```
180
- *
181
- * @param message The message template. Placeholders to be replaced with
182
- * `values` are indicated by keys in curly braces (e.g.,
183
- * `{value}`).
184
- * @param properties The values to replace placeholders with. For lazy
185
- * evaluation, this can be a callback that returns the
186
- * properties.
187
- */
188
- info(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
189
- /**
190
- * Log an informational values with no message. This is useful when you
191
- * want to log properties without a message, e.g., when you want to log
192
- * the context of a request or an operation.
193
- *
194
- * ```typescript
195
- * logger.info({ method: 'GET', url: '/api/v1/resource' });
196
- * ```
197
- *
198
- * Note that this is a shorthand for:
199
- *
200
- * ```typescript
201
- * logger.info('{*}', { method: 'GET', url: '/api/v1/resource' });
202
- * ```
203
- *
204
- * If the properties are expensive to compute, you cannot use this shorthand
205
- * and should use the following syntax instead:
206
- *
207
- * ```typescript
208
- * logger.info('{*}', () => ({
209
- * method: expensiveMethod(),
210
- * url: expensiveUrl(),
211
- * }));
212
- * ```
213
- *
214
- * @param properties The values to log. Note that this does not take
215
- * a callback.
216
- * @since 0.11.0
217
- */
218
- info(properties: Record<string, unknown>): void;
219
- /**
220
- * Lazily log an informational message. Use this when the message values are
221
- * expensive to compute and should only be computed if the message is actually
222
- * logged.
223
- *
224
- * ```typescript
225
- * logger.info(l => l`An info message with ${expensiveValue()}.`);
226
- * ```
227
- *
228
- * @param callback A callback that returns the message template prefix.
229
- * @throws {TypeError} If no log record was made inside the callback.
230
- */
231
- info(callback: LogCallback): void;
232
- /**
233
- * Log a warning message. Use this as a template string prefix.
234
- *
235
- * ```typescript
236
- * logger.warn `A warning message with ${value}.`;
237
- * ```
238
- *
239
- * @param message The message template strings array.
240
- * @param values The message template values.
241
- */
242
- warn(message: TemplateStringsArray, ...values: readonly unknown[]): void;
243
- /**
244
- * Log a warning message with properties.
245
- *
246
- * ```typescript
247
- * logger.warn('A warning message with {value}.', { value });
248
- * ```
249
- *
250
- * If the properties are expensive to compute, you can pass a callback that
251
- * returns the properties:
252
- *
253
- * ```typescript
254
- * logger.warn(
255
- * 'A warning message with {value}.',
256
- * () => ({ value: expensiveComputation() })
257
- * );
258
- * ```
259
- *
260
- * @param message The message template. Placeholders to be replaced with
261
- * `values` are indicated by keys in curly braces (e.g.,
262
- * `{value}`).
263
- * @param properties The values to replace placeholders with. For lazy
264
- * evaluation, this can be a callback that returns the
265
- * properties.
266
- */
267
- warn(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
268
- /**
269
- * Log a warning values with no message. This is useful when you
270
- * want to log properties without a message, e.g., when you want to log
271
- * the context of a request or an operation.
272
- *
273
- * ```typescript
274
- * logger.warn({ method: 'GET', url: '/api/v1/resource' });
275
- * ```
276
- *
277
- * Note that this is a shorthand for:
278
- *
279
- * ```typescript
280
- * logger.warn('{*}', { method: 'GET', url: '/api/v1/resource' });
281
- * ```
282
- *
283
- * If the properties are expensive to compute, you cannot use this shorthand
284
- * and should use the following syntax instead:
285
- *
286
- * ```typescript
287
- * logger.warn('{*}', () => ({
288
- * method: expensiveMethod(),
289
- * url: expensiveUrl(),
290
- * }));
291
- * ```
292
- *
293
- * @param properties The values to log. Note that this does not take
294
- * a callback.
295
- * @since 0.11.0
296
- */
297
- warn(properties: Record<string, unknown>): void;
298
- /**
299
- * Lazily log a warning message. Use this when the message values are
300
- * expensive to compute and should only be computed if the message is actually
301
- * logged.
302
- *
303
- * ```typescript
304
- * logger.warn(l => l`A warning message with ${expensiveValue()}.`);
305
- * ```
306
- *
307
- * @param callback A callback that returns the message template prefix.
308
- * @throws {TypeError} If no log record was made inside the callback.
309
- */
310
- warn(callback: LogCallback): void;
311
- /**
312
- * Log an error message. Use this as a template string prefix.
313
- *
314
- * ```typescript
315
- * logger.error `An error message with ${value}.`;
316
- * ```
317
- *
318
- * @param message The message template strings array.
319
- * @param values The message template values.
320
- */
321
- error(message: TemplateStringsArray, ...values: readonly unknown[]): void;
322
- /**
323
- * Log an error message with properties.
324
- *
325
- * ```typescript
326
- * logger.warn('An error message with {value}.', { value });
327
- * ```
328
- *
329
- * If the properties are expensive to compute, you can pass a callback that
330
- * returns the properties:
331
- *
332
- * ```typescript
333
- * logger.error(
334
- * 'An error message with {value}.',
335
- * () => ({ value: expensiveComputation() })
336
- * );
337
- * ```
338
- *
339
- * @param message The message template. Placeholders to be replaced with
340
- * `values` are indicated by keys in curly braces (e.g.,
341
- * `{value}`).
342
- * @param properties The values to replace placeholders with. For lazy
343
- * evaluation, this can be a callback that returns the
344
- * properties.
345
- */
346
- error(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
347
- /**
348
- * Log an error values with no message. This is useful when you
349
- * want to log properties without a message, e.g., when you want to log
350
- * the context of a request or an operation.
351
- *
352
- * ```typescript
353
- * logger.error({ method: 'GET', url: '/api/v1/resource' });
354
- * ```
355
- *
356
- * Note that this is a shorthand for:
357
- *
358
- * ```typescript
359
- * logger.error('{*}', { method: 'GET', url: '/api/v1/resource' });
360
- * ```
361
- *
362
- * If the properties are expensive to compute, you cannot use this shorthand
363
- * and should use the following syntax instead:
364
- *
365
- * ```typescript
366
- * logger.error('{*}', () => ({
367
- * method: expensiveMethod(),
368
- * url: expensiveUrl(),
369
- * }));
370
- * ```
371
- *
372
- * @param properties The values to log. Note that this does not take
373
- * a callback.
374
- * @since 0.11.0
375
- */
376
- error(properties: Record<string, unknown>): void;
377
- /**
378
- * Lazily log an error message. Use this when the message values are
379
- * expensive to compute and should only be computed if the message is actually
380
- * logged.
381
- *
382
- * ```typescript
383
- * logger.error(l => l`An error message with ${expensiveValue()}.`);
384
- * ```
385
- *
386
- * @param callback A callback that returns the message template prefix.
387
- * @throws {TypeError} If no log record was made inside the callback.
388
- */
389
- error(callback: LogCallback): void;
390
- /**
391
- * Log a fatal error message. Use this as a template string prefix.
392
- *
393
- * ```typescript
394
- * logger.fatal `A fatal error message with ${value}.`;
395
- * ```
396
- *
397
- * @param message The message template strings array.
398
- * @param values The message template values.
399
- */
400
- fatal(message: TemplateStringsArray, ...values: readonly unknown[]): void;
401
- /**
402
- * Log a fatal error message with properties.
403
- *
404
- * ```typescript
405
- * logger.warn('A fatal error message with {value}.', { value });
406
- * ```
407
- *
408
- * If the properties are expensive to compute, you can pass a callback that
409
- * returns the properties:
410
- *
411
- * ```typescript
412
- * logger.fatal(
413
- * 'A fatal error message with {value}.',
414
- * () => ({ value: expensiveComputation() })
415
- * );
416
- * ```
417
- *
418
- * @param message The message template. Placeholders to be replaced with
419
- * `values` are indicated by keys in curly braces (e.g.,
420
- * `{value}`).
421
- * @param properties The values to replace placeholders with. For lazy
422
- * evaluation, this can be a callback that returns the
423
- * properties.
424
- */
425
- fatal(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
426
- /**
427
- * Log a fatal error values with no message. This is useful when you
428
- * want to log properties without a message, e.g., when you want to log
429
- * the context of a request or an operation.
430
- *
431
- * ```typescript
432
- * logger.fatal({ method: 'GET', url: '/api/v1/resource' });
433
- * ```
434
- *
435
- * Note that this is a shorthand for:
436
- *
437
- * ```typescript
438
- * logger.fatal('{*}', { method: 'GET', url: '/api/v1/resource' });
439
- * ```
440
- *
441
- * If the properties are expensive to compute, you cannot use this shorthand
442
- * and should use the following syntax instead:
443
- *
444
- * ```typescript
445
- * logger.fatal('{*}', () => ({
446
- * method: expensiveMethod(),
447
- * url: expensiveUrl(),
448
- * }));
449
- * ```
450
- *
451
- * @param properties The values to log. Note that this does not take
452
- * a callback.
453
- * @since 0.11.0
454
- */
455
- fatal(properties: Record<string, unknown>): void;
456
- /**
457
- * Lazily log a fatal error message. Use this when the message values are
458
- * expensive to compute and should only be computed if the message is actually
459
- * logged.
460
- *
461
- * ```typescript
462
- * logger.fatal(l => l`A fatal error message with ${expensiveValue()}.`);
463
- * ```
464
- *
465
- * @param callback A callback that returns the message template prefix.
466
- * @throws {TypeError} If no log record was made inside the callback.
467
- */
468
- fatal(callback: LogCallback): void;
469
- }
470
- /**
471
- * A logging callback function. It is used to defer the computation of a
472
- * message template until it is actually logged.
473
- * @param prefix The message template prefix.
474
- * @returns The rendered message array.
475
- */
476
- export type LogCallback = (prefix: LogTemplatePrefix) => unknown[];
477
- /**
478
- * A logging template prefix function. It is used to log a message in
479
- * a {@link LogCallback} function.
480
- * @param message The message template strings array.
481
- * @param values The message template values.
482
- * @returns The rendered message array.
483
- */
484
- export type LogTemplatePrefix = (message: TemplateStringsArray, ...values: unknown[]) => unknown[];
485
- /**
486
- * Get a logger with the given category.
487
- *
488
- * ```typescript
489
- * const logger = getLogger(["my-app"]);
490
- * ```
491
- *
492
- * @param category The category of the logger. It can be a string or an array
493
- * of strings. If it is a string, it is equivalent to an array
494
- * with a single element.
495
- * @returns The logger.
496
- */
497
- export declare function getLogger(category?: string | readonly string[]): Logger;
498
- /**
499
- * A logger implementation. Do not use this directly; use {@link getLogger}
500
- * instead. This class is exported for testing purposes.
501
- */
502
- export declare class LoggerImpl implements Logger {
503
- readonly parent: LoggerImpl | null;
504
- readonly children: Record<string, LoggerImpl | WeakRef<LoggerImpl>>;
505
- readonly category: readonly string[];
506
- readonly sinks: Sink[];
507
- parentSinks: "inherit" | "override";
508
- readonly filters: Filter[];
509
- lowestLevel: LogLevel | null;
510
- contextLocalStorage?: ContextLocalStorage<Record<string, unknown>>;
511
- static getLogger(category?: string | readonly string[]): LoggerImpl;
512
- private constructor();
513
- getChild(subcategory: string | readonly [string] | readonly [string, ...(readonly string[])]): LoggerImpl;
514
- /**
515
- * Reset the logger. This removes all sinks and filters from the logger.
516
- */
517
- reset(): void;
518
- /**
519
- * Reset the logger and all its descendants. This removes all sinks and
520
- * filters from the logger and all its descendants.
521
- */
522
- resetDescendants(): void;
523
- with(properties: Record<string, unknown>): Logger;
524
- filter(record: LogRecord): boolean;
525
- getSinks(level: LogLevel): Iterable<Sink>;
526
- emit(record: LogRecord, bypassSinks?: Set<Sink>): void;
527
- log(level: LogLevel, rawMessage: string, properties: Record<string, unknown> | (() => Record<string, unknown>), bypassSinks?: Set<Sink>): void;
528
- logLazily(level: LogLevel, callback: LogCallback, properties?: Record<string, unknown>): void;
529
- logTemplate(level: LogLevel, messageTemplate: TemplateStringsArray, values: unknown[], properties?: Record<string, unknown>): void;
530
- debug(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
531
- info(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
532
- warn(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
533
- error(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
534
- fatal(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
535
- }
536
- /**
537
- * A logger implementation with contextual properties. Do not use this
538
- * directly; use {@link Logger.with} instead. This class is exported
539
- * for testing purposes.
540
- */
541
- export declare class LoggerCtx implements Logger {
542
- logger: LoggerImpl;
543
- properties: Record<string, unknown>;
544
- constructor(logger: LoggerImpl, properties: Record<string, unknown>);
545
- get category(): readonly string[];
546
- get parent(): Logger | null;
547
- getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
548
- with(properties: Record<string, unknown>): Logger;
549
- log(level: LogLevel, message: string, properties: Record<string, unknown> | (() => Record<string, unknown>), bypassSinks?: Set<Sink>): void;
550
- logLazily(level: LogLevel, callback: LogCallback): void;
551
- logTemplate(level: LogLevel, messageTemplate: TemplateStringsArray, values: unknown[]): void;
552
- debug(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
553
- info(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
554
- warn(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
555
- error(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
556
- fatal(message: TemplateStringsArray | string | LogCallback | Record<string, unknown>, ...values: unknown[]): void;
557
- }
558
- /**
559
- * Parse a message template into a message template array and a values array.
560
- * @param template The message template.
561
- * @param properties The values to replace placeholders with.
562
- * @returns The message template array and the values array.
563
- */
564
- export declare function parseMessageTemplate(template: string, properties: Record<string, unknown>): readonly unknown[];
565
- /**
566
- * Render a message template with values.
567
- * @param template The message template.
568
- * @param values The message template values.
569
- * @returns The message template values interleaved between the substitution
570
- * values.
571
- */
572
- export declare function renderMessage(template: TemplateStringsArray, values: readonly unknown[]): unknown[];
573
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ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GACnB,IAAI;CAWR;AAOD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,SAAS,OAAO,EAAE,CA0CpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,SAAS,OAAO,EAAE,GACzB,OAAO,EAAE,CAOX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.test.d.ts","sourceRoot":"","sources":["../src/logger.test.ts"],"names":[],"mappings":""}
package/types/mod.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export { type Config, ConfigError, configure, configureSync, dispose, disposeSync, getConfig, type LoggerConfig, reset, resetSync, } from "./config.js";
2
- export { type ContextLocalStorage, withContext } from "./context.js";
3
- export { type Filter, type FilterLike, getLevelFilter, toFilter, } from "./filter.js";
4
- export { type AnsiColor, ansiColorFormatter, type AnsiColorFormatterOptions, type AnsiStyle, type ConsoleFormatter, defaultConsoleFormatter, defaultTextFormatter, type FormattedValues, getAnsiColorFormatter, getJsonLinesFormatter, getTextFormatter, jsonLinesFormatter, type JsonLinesFormatterOptions, type TextFormatter, type TextFormatterOptions, } from "./formatter.js";
5
- export { compareLogLevel, isLogLevel, type LogLevel, parseLogLevel, } from "./level.js";
6
- export { getLogger, type Logger } from "./logger.js";
7
- export type { LogRecord } from "./record.js";
8
- export { type ConsoleSinkOptions, getConsoleSink, getStreamSink, type Sink, type StreamSinkOptions, withFilter, } from "./sink.js";
9
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,OAAO,EACP,WAAW,EACX,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,EACL,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,UAAU,EACf,cAAc,EACd,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,SAAS,EACd,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,UAAU,EACV,KAAK,QAAQ,EACb,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,KAAK,kBAAkB,EACvB,cAAc,EACd,aAAa,EACb,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,UAAU,GACX,MAAM,WAAW,CAAC"}
@@ -1,12 +0,0 @@
1
- interface InspectOptions {
2
- colors?: boolean;
3
- depth?: number | null;
4
- compact?: boolean;
5
- [key: string]: unknown;
6
- }
7
- interface UtilInterface {
8
- inspect(obj: unknown, options?: InspectOptions): string;
9
- }
10
- declare let utilModule: UtilInterface;
11
- export default utilModule;
12
- //# sourceMappingURL=nodeUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeUtil.d.ts","sourceRoot":"","sources":["../src/nodeUtil.ts"],"names":[],"mappings":"AAgBA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,aAAa;IACrB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;CACzD;AAGD,QAAA,IAAI,UAAU,EAAE,aAKf,CAAC;AAcF,eAAe,UAAU,CAAC"}
package/types/record.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import type { LogLevel } from "./level.js";
2
- /**
3
- * A log record.
4
- */
5
- export interface LogRecord {
6
- /**
7
- * The category of the logger that produced the log record.
8
- */
9
- readonly category: readonly string[];
10
- /**
11
- * The log level.
12
- */
13
- readonly level: LogLevel;
14
- /**
15
- * The log message. This is the result of substituting the message template
16
- * with the values. The number of elements in this array is always odd,
17
- * with the message template values interleaved between the substitution
18
- * values.
19
- */
20
- readonly message: readonly unknown[];
21
- /**
22
- * The raw log message. This is the original message template without any
23
- * further processing. It can be either:
24
- *
25
- * - A string without any substitutions if the log record was created with
26
- * a method call syntax, e.g., "Hello, {name}!" for
27
- * `logger.info("Hello, {name}!", { name })`.
28
- * - A template string array if the log record was created with a tagged
29
- * template literal syntax, e.g., `["Hello, ", "!"]` for
30
- * ``logger.info`Hello, ${name}!```.
31
- *
32
- * @since 0.6.0
33
- */
34
- readonly rawMessage: string | TemplateStringsArray;
35
- /**
36
- * The timestamp of the log record in milliseconds since the Unix epoch.
37
- */
38
- readonly timestamp: number;
39
- /**
40
- * The extra properties of the log record.
41
- */
42
- readonly properties: Record<string, unknown>;
43
- }
44
- //# sourceMappingURL=record.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MA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