@logtape/logtape 0.12.0-dev.184 → 0.12.0-dev.186
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.
- package/README.md +1 -2
- package/config.test.ts +3 -3
- package/deno.json +1 -1
- package/dist/filter.cjs +2 -1
- package/dist/filter.js +2 -1
- package/dist/filter.js.map +1 -1
- package/dist/formatter.cjs +3 -0
- package/dist/formatter.d.cts +1 -0
- package/dist/formatter.d.cts.map +1 -1
- package/dist/formatter.d.ts +1 -0
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +3 -0
- package/dist/formatter.js.map +1 -1
- package/dist/level.cjs +3 -0
- package/dist/level.d.cts +1 -1
- package/dist/level.d.cts.map +1 -1
- package/dist/level.d.ts +1 -1
- package/dist/level.d.ts.map +1 -1
- package/dist/level.js +3 -0
- package/dist/level.js.map +1 -1
- package/dist/logger.cjs +20 -2
- package/dist/logger.d.cts +164 -0
- package/dist/logger.d.cts.map +1 -1
- package/dist/logger.d.ts +164 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +20 -2
- package/dist/logger.js.map +1 -1
- package/dist/sink.cjs +1 -0
- package/dist/sink.d.cts +1 -0
- package/dist/sink.d.cts.map +1 -1
- package/dist/sink.d.ts +1 -0
- package/dist/sink.d.ts.map +1 -1
- package/dist/sink.js +1 -0
- package/dist/sink.js.map +1 -1
- package/filter.test.ts +15 -1
- package/filter.ts +8 -1
- package/fixtures.ts +5 -0
- package/formatter.test.ts +2 -0
- package/formatter.ts +4 -0
- package/level.ts +10 -1
- package/logger.test.ts +10 -1
- package/logger.ts +240 -2
- package/package.json +1 -1
- package/sink.test.ts +30 -1
- package/sink.ts +2 -0
package/dist/logger.d.cts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* ```typescript
|
|
8
8
|
* const logger = getLogger("category");
|
|
9
|
+
* logger.trace `A trace message with ${value}`
|
|
9
10
|
* logger.debug `A debug message with ${value}.`;
|
|
10
11
|
* logger.info `An info message with ${value}.`;
|
|
11
12
|
* logger.warn `A warning message with ${value}.`;
|
|
@@ -69,6 +70,87 @@ interface Logger {
|
|
|
69
70
|
* @since 0.5.0
|
|
70
71
|
*/
|
|
71
72
|
with(properties: Record<string, unknown>): Logger;
|
|
73
|
+
/**
|
|
74
|
+
* Log a trace message. Use this as a template string prefix.
|
|
75
|
+
*
|
|
76
|
+
* ```typescript
|
|
77
|
+
* logger.trace `A trace message with ${value}.`;
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param message The message template strings array.
|
|
81
|
+
* @param values The message template values.
|
|
82
|
+
* @since 0.12.0
|
|
83
|
+
*/
|
|
84
|
+
trace(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
85
|
+
/**
|
|
86
|
+
* Log a trace message with properties.
|
|
87
|
+
*
|
|
88
|
+
* ```typescript
|
|
89
|
+
* logger.trace('A trace message with {value}.', { value });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
93
|
+
* returns the properties:
|
|
94
|
+
*
|
|
95
|
+
* ```typescript
|
|
96
|
+
* logger.trace(
|
|
97
|
+
* 'A trace message with {value}.',
|
|
98
|
+
* () => ({ value: expensiveComputation() })
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @param message The message template. Placeholders to be replaced with
|
|
103
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
104
|
+
* `{value}`).
|
|
105
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
106
|
+
* evaluation, this can be a callback that returns the
|
|
107
|
+
* properties.
|
|
108
|
+
* @since 0.12.0
|
|
109
|
+
*/
|
|
110
|
+
trace(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
111
|
+
/**
|
|
112
|
+
* Log a trace 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.trace({ method: 'GET', url: '/api/v1/resource' });
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* Note that this is a shorthand for:
|
|
121
|
+
*
|
|
122
|
+
* ```typescript
|
|
123
|
+
* logger.trace('{*}', { 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.trace('{*}', () => ({
|
|
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.12.0
|
|
139
|
+
*/
|
|
140
|
+
trace(properties: Record<string, unknown>): void;
|
|
141
|
+
/**
|
|
142
|
+
* Lazily log a trace 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.trace(l => l`A trace 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
|
+
* @since 0.12.0
|
|
152
|
+
*/
|
|
153
|
+
trace(callback: LogCallback): void;
|
|
72
154
|
/**
|
|
73
155
|
* Log a debug message. Use this as a template string prefix.
|
|
74
156
|
*
|
|
@@ -305,6 +387,88 @@ interface Logger {
|
|
|
305
387
|
* @throws {TypeError} If no log record was made inside the callback.
|
|
306
388
|
*/
|
|
307
389
|
warn(callback: LogCallback): void;
|
|
390
|
+
/**
|
|
391
|
+
* Log a warning message. Use this as a template string prefix.
|
|
392
|
+
*
|
|
393
|
+
* ```typescript
|
|
394
|
+
* logger.warning `A warning message with ${value}.`;
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @param message The message template strings array.
|
|
398
|
+
* @param values The message template values.
|
|
399
|
+
* @since 0.12.0
|
|
400
|
+
*/
|
|
401
|
+
warning(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
402
|
+
/**
|
|
403
|
+
* Log a warning message with properties.
|
|
404
|
+
*
|
|
405
|
+
* ```typescript
|
|
406
|
+
* logger.warning('A warning message with {value}.', { value });
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
410
|
+
* returns the properties:
|
|
411
|
+
*
|
|
412
|
+
* ```typescript
|
|
413
|
+
* logger.warning(
|
|
414
|
+
* 'A warning message with {value}.',
|
|
415
|
+
* () => ({ value: expensiveComputation() })
|
|
416
|
+
* );
|
|
417
|
+
* ```
|
|
418
|
+
*
|
|
419
|
+
* @param message The message template. Placeholders to be replaced with
|
|
420
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
421
|
+
* `{value}`).
|
|
422
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
423
|
+
* evaluation, this can be a callback that returns the
|
|
424
|
+
* properties.
|
|
425
|
+
* @since 0.12.0
|
|
426
|
+
*/
|
|
427
|
+
warning(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
428
|
+
/**
|
|
429
|
+
* Log a warning values with no message. This is useful when you
|
|
430
|
+
* want to log properties without a message, e.g., when you want to log
|
|
431
|
+
* the context of a request or an operation.
|
|
432
|
+
*
|
|
433
|
+
* ```typescript
|
|
434
|
+
* logger.warning({ method: 'GET', url: '/api/v1/resource' });
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* Note that this is a shorthand for:
|
|
438
|
+
*
|
|
439
|
+
* ```typescript
|
|
440
|
+
* logger.warning('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
444
|
+
* and should use the following syntax instead:
|
|
445
|
+
*
|
|
446
|
+
* ```typescript
|
|
447
|
+
* logger.warning('{*}', () => ({
|
|
448
|
+
* method: expensiveMethod(),
|
|
449
|
+
* url: expensiveUrl(),
|
|
450
|
+
* }));
|
|
451
|
+
* ```
|
|
452
|
+
*
|
|
453
|
+
* @param properties The values to log. Note that this does not take
|
|
454
|
+
* a callback.
|
|
455
|
+
* @since 0.12.0
|
|
456
|
+
*/
|
|
457
|
+
warning(properties: Record<string, unknown>): void;
|
|
458
|
+
/**
|
|
459
|
+
* Lazily log a warning message. Use this when the message values are
|
|
460
|
+
* expensive to compute and should only be computed if the message is actually
|
|
461
|
+
* logged.
|
|
462
|
+
*
|
|
463
|
+
* ```typescript
|
|
464
|
+
* logger.warning(l => l`A warning message with ${expensiveValue()}.`);
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* @param callback A callback that returns the message template prefix.
|
|
468
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
469
|
+
* @since 0.12.0
|
|
470
|
+
*/
|
|
471
|
+
warning(callback: LogCallback): void;
|
|
308
472
|
/**
|
|
309
473
|
* Log an error message. Use this as a template string prefix.
|
|
310
474
|
*
|
package/dist/logger.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.cts","names":[],"sources":["../logger.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.cts","names":[],"sources":["../logger.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAqSkD,UAjRjC,MAAA,CAiRiC;EAAM;;;EA0DpB,SA4BnB,QAAA,EAAA,SAAA,MAAA,EAAA;EAAM;;;;EA2DgB,SA6BtB,MAAA,EArbE,MAqbF,GAAA,IAAA;EAAM;;;;;;;;;;;;;AA2NM;AAS7B;AASA;A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
9
10
|
* logger.debug `A debug message with ${value}.`;
|
|
10
11
|
* logger.info `An info message with ${value}.`;
|
|
11
12
|
* logger.warn `A warning message with ${value}.`;
|
|
@@ -69,6 +70,87 @@ interface Logger {
|
|
|
69
70
|
* @since 0.5.0
|
|
70
71
|
*/
|
|
71
72
|
with(properties: Record<string, unknown>): Logger;
|
|
73
|
+
/**
|
|
74
|
+
* Log a trace message. Use this as a template string prefix.
|
|
75
|
+
*
|
|
76
|
+
* ```typescript
|
|
77
|
+
* logger.trace `A trace message with ${value}.`;
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param message The message template strings array.
|
|
81
|
+
* @param values The message template values.
|
|
82
|
+
* @since 0.12.0
|
|
83
|
+
*/
|
|
84
|
+
trace(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
85
|
+
/**
|
|
86
|
+
* Log a trace message with properties.
|
|
87
|
+
*
|
|
88
|
+
* ```typescript
|
|
89
|
+
* logger.trace('A trace message with {value}.', { value });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
93
|
+
* returns the properties:
|
|
94
|
+
*
|
|
95
|
+
* ```typescript
|
|
96
|
+
* logger.trace(
|
|
97
|
+
* 'A trace message with {value}.',
|
|
98
|
+
* () => ({ value: expensiveComputation() })
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @param message The message template. Placeholders to be replaced with
|
|
103
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
104
|
+
* `{value}`).
|
|
105
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
106
|
+
* evaluation, this can be a callback that returns the
|
|
107
|
+
* properties.
|
|
108
|
+
* @since 0.12.0
|
|
109
|
+
*/
|
|
110
|
+
trace(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
111
|
+
/**
|
|
112
|
+
* Log a trace 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.trace({ method: 'GET', url: '/api/v1/resource' });
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* Note that this is a shorthand for:
|
|
121
|
+
*
|
|
122
|
+
* ```typescript
|
|
123
|
+
* logger.trace('{*}', { 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.trace('{*}', () => ({
|
|
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.12.0
|
|
139
|
+
*/
|
|
140
|
+
trace(properties: Record<string, unknown>): void;
|
|
141
|
+
/**
|
|
142
|
+
* Lazily log a trace 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.trace(l => l`A trace 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
|
+
* @since 0.12.0
|
|
152
|
+
*/
|
|
153
|
+
trace(callback: LogCallback): void;
|
|
72
154
|
/**
|
|
73
155
|
* Log a debug message. Use this as a template string prefix.
|
|
74
156
|
*
|
|
@@ -305,6 +387,88 @@ interface Logger {
|
|
|
305
387
|
* @throws {TypeError} If no log record was made inside the callback.
|
|
306
388
|
*/
|
|
307
389
|
warn(callback: LogCallback): void;
|
|
390
|
+
/**
|
|
391
|
+
* Log a warning message. Use this as a template string prefix.
|
|
392
|
+
*
|
|
393
|
+
* ```typescript
|
|
394
|
+
* logger.warning `A warning message with ${value}.`;
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @param message The message template strings array.
|
|
398
|
+
* @param values The message template values.
|
|
399
|
+
* @since 0.12.0
|
|
400
|
+
*/
|
|
401
|
+
warning(message: TemplateStringsArray, ...values: readonly unknown[]): void;
|
|
402
|
+
/**
|
|
403
|
+
* Log a warning message with properties.
|
|
404
|
+
*
|
|
405
|
+
* ```typescript
|
|
406
|
+
* logger.warning('A warning message with {value}.', { value });
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* If the properties are expensive to compute, you can pass a callback that
|
|
410
|
+
* returns the properties:
|
|
411
|
+
*
|
|
412
|
+
* ```typescript
|
|
413
|
+
* logger.warning(
|
|
414
|
+
* 'A warning message with {value}.',
|
|
415
|
+
* () => ({ value: expensiveComputation() })
|
|
416
|
+
* );
|
|
417
|
+
* ```
|
|
418
|
+
*
|
|
419
|
+
* @param message The message template. Placeholders to be replaced with
|
|
420
|
+
* `values` are indicated by keys in curly braces (e.g.,
|
|
421
|
+
* `{value}`).
|
|
422
|
+
* @param properties The values to replace placeholders with. For lazy
|
|
423
|
+
* evaluation, this can be a callback that returns the
|
|
424
|
+
* properties.
|
|
425
|
+
* @since 0.12.0
|
|
426
|
+
*/
|
|
427
|
+
warning(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
428
|
+
/**
|
|
429
|
+
* Log a warning values with no message. This is useful when you
|
|
430
|
+
* want to log properties without a message, e.g., when you want to log
|
|
431
|
+
* the context of a request or an operation.
|
|
432
|
+
*
|
|
433
|
+
* ```typescript
|
|
434
|
+
* logger.warning({ method: 'GET', url: '/api/v1/resource' });
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* Note that this is a shorthand for:
|
|
438
|
+
*
|
|
439
|
+
* ```typescript
|
|
440
|
+
* logger.warning('{*}', { method: 'GET', url: '/api/v1/resource' });
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
* If the properties are expensive to compute, you cannot use this shorthand
|
|
444
|
+
* and should use the following syntax instead:
|
|
445
|
+
*
|
|
446
|
+
* ```typescript
|
|
447
|
+
* logger.warning('{*}', () => ({
|
|
448
|
+
* method: expensiveMethod(),
|
|
449
|
+
* url: expensiveUrl(),
|
|
450
|
+
* }));
|
|
451
|
+
* ```
|
|
452
|
+
*
|
|
453
|
+
* @param properties The values to log. Note that this does not take
|
|
454
|
+
* a callback.
|
|
455
|
+
* @since 0.12.0
|
|
456
|
+
*/
|
|
457
|
+
warning(properties: Record<string, unknown>): void;
|
|
458
|
+
/**
|
|
459
|
+
* Lazily log a warning message. Use this when the message values are
|
|
460
|
+
* expensive to compute and should only be computed if the message is actually
|
|
461
|
+
* logged.
|
|
462
|
+
*
|
|
463
|
+
* ```typescript
|
|
464
|
+
* logger.warning(l => l`A warning message with ${expensiveValue()}.`);
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* @param callback A callback that returns the message template prefix.
|
|
468
|
+
* @throws {TypeError} If no log record was made inside the callback.
|
|
469
|
+
* @since 0.12.0
|
|
470
|
+
*/
|
|
471
|
+
warning(callback: LogCallback): void;
|
|
308
472
|
/**
|
|
309
473
|
* Log an error message. Use this as a template string prefix.
|
|
310
474
|
*
|
package/dist/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","names":[],"sources":["../logger.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","names":[],"sources":["../logger.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAqSkD,UAjRjC,MAAA,CAiRiC;EAAM;;;EA0DpB,SA4BnB,QAAA,EAAA,SAAA,MAAA,EAAA;EAAM;;;;EA2DgB,SA6BtB,MAAA,EArbE,MAqbF,GAAA,IAAA;EAAM;;;;;;;;;;;;;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
|
|
34
|
-
lowestLevel = "
|
|
34
|
+
lowestLevel = "trace";
|
|
35
35
|
contextLocalStorage;
|
|
36
36
|
static getLogger(category = []) {
|
|
37
37
|
let rootLogger = globalRootLoggerSymbol in globalThis ? globalThis[globalRootLoggerSymbol] ?? null : null;
|
|
@@ -68,7 +68,7 @@ var LoggerImpl = class LoggerImpl {
|
|
|
68
68
|
while (this.sinks.length > 0) this.sinks.shift();
|
|
69
69
|
this.parentSinks = "inherit";
|
|
70
70
|
while (this.filters.length > 0) this.filters.shift();
|
|
71
|
-
this.lowestLevel = "
|
|
71
|
+
this.lowestLevel = "trace";
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Reset the logger and all its descendants. This removes all sinks and
|
|
@@ -189,6 +189,12 @@ var LoggerImpl = class LoggerImpl {
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
+
trace(message, ...values) {
|
|
193
|
+
if (typeof message === "string") this.log("trace", message, values[0] ?? {});
|
|
194
|
+
else if (typeof message === "function") this.logLazily("trace", message);
|
|
195
|
+
else if (!Array.isArray(message)) this.log("trace", "{*}", message);
|
|
196
|
+
else this.logTemplate("trace", message, values);
|
|
197
|
+
}
|
|
192
198
|
debug(message, ...values) {
|
|
193
199
|
if (typeof message === "string") this.log("debug", message, values[0] ?? {});
|
|
194
200
|
else if (typeof message === "function") this.logLazily("debug", message);
|
|
@@ -207,6 +213,9 @@ var LoggerImpl = class LoggerImpl {
|
|
|
207
213
|
else if (!Array.isArray(message)) this.log("warning", "{*}", message);
|
|
208
214
|
else this.logTemplate("warning", message, values);
|
|
209
215
|
}
|
|
216
|
+
warning(message, ...values) {
|
|
217
|
+
this.warn(message, ...values);
|
|
218
|
+
}
|
|
210
219
|
error(message, ...values) {
|
|
211
220
|
if (typeof message === "string") this.log("error", message, values[0] ?? {});
|
|
212
221
|
else if (typeof message === "function") this.logLazily("error", message);
|
|
@@ -262,6 +271,12 @@ var LoggerCtx = class LoggerCtx {
|
|
|
262
271
|
logTemplate(level, messageTemplate, values) {
|
|
263
272
|
this.logger.logTemplate(level, messageTemplate, values, this.properties);
|
|
264
273
|
}
|
|
274
|
+
trace(message, ...values) {
|
|
275
|
+
if (typeof message === "string") this.log("trace", message, values[0] ?? {});
|
|
276
|
+
else if (typeof message === "function") this.logLazily("trace", message);
|
|
277
|
+
else if (!Array.isArray(message)) this.log("trace", "{*}", message);
|
|
278
|
+
else this.logTemplate("trace", message, values);
|
|
279
|
+
}
|
|
265
280
|
debug(message, ...values) {
|
|
266
281
|
if (typeof message === "string") this.log("debug", message, values[0] ?? {});
|
|
267
282
|
else if (typeof message === "function") this.logLazily("debug", message);
|
|
@@ -280,6 +295,9 @@ var LoggerCtx = class LoggerCtx {
|
|
|
280
295
|
else if (!Array.isArray(message)) this.log("warning", "{*}", message);
|
|
281
296
|
else this.logTemplate("warning", message, values);
|
|
282
297
|
}
|
|
298
|
+
warning(message, ...values) {
|
|
299
|
+
this.warn(message, ...values);
|
|
300
|
+
}
|
|
283
301
|
error(message, ...values) {
|
|
284
302
|
if (typeof message === "string") this.log("error", message, values[0] ?? {});
|
|
285
303
|
else if (typeof message === "function") this.logLazily("error", message);
|