@logtape/logtape 0.5.0-dev.53 → 0.5.0-dev.60
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 +30 -0
- package/esm/logger.js +111 -4
- package/package.json +1 -1
- package/script/config.js +5 -5
- package/script/filesink.node.js +3 -3
- package/script/filter.js +2 -3
- package/script/formatter.js +2 -3
- package/script/level.js +2 -3
- package/script/logger.js +116 -8
- package/script/sink.js +5 -6
- package/types/filesink.node.d.ts +0 -1
- package/types/filesink.node.d.ts.map +1 -1
- package/types/fs.d.ts +0 -1
- package/types/logger.d.ts +50 -0
- package/types/logger.d.ts.map +1 -1
- package/types/sink.d.ts +0 -1
- package/types/sink.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -182,6 +182,36 @@ await configure({
|
|
|
182
182
|
~~~~
|
|
183
183
|
|
|
184
184
|
|
|
185
|
+
Contexts
|
|
186
|
+
--------
|
|
187
|
+
|
|
188
|
+
**Contexts are available since LogTape 0.5.0.**
|
|
189
|
+
|
|
190
|
+
LogTape provides a context system to reuse the same properties across log
|
|
191
|
+
messages. A context is a key-value map. You can set a context for a logger
|
|
192
|
+
and log messages with the context. Here's an example of setting a context
|
|
193
|
+
for a logger:
|
|
194
|
+
|
|
195
|
+
~~~~ typescript
|
|
196
|
+
const logger = getLogger(["my-app", "my-module"]);
|
|
197
|
+
const ctx = logger.with({ userId: 1234, requestId: "abc" });
|
|
198
|
+
ctx.info `This log message will have the context (userId & requestId).`;
|
|
199
|
+
ctx.warn("Context can be used inside message template: {userId}, {requestId}.");
|
|
200
|
+
~~~~
|
|
201
|
+
|
|
202
|
+
The context is inherited by child loggers. Here's an example of setting a
|
|
203
|
+
context for a parent logger and logging messages with a child logger:
|
|
204
|
+
|
|
205
|
+
~~~~ typescript
|
|
206
|
+
const logger = getLogger(["my-app"]);
|
|
207
|
+
const parentCtx = logger.with({ userId: 1234, requestId: "abc" });
|
|
208
|
+
const childCtx = parentCtx.getLogger(["my-module"]);
|
|
209
|
+
childCtx.debug("This log message will have the context: {userId} {requestId}.");
|
|
210
|
+
~~~~
|
|
211
|
+
|
|
212
|
+
Contexts are particularly useful when you want to do structured logging.
|
|
213
|
+
|
|
214
|
+
|
|
185
215
|
Sinks
|
|
186
216
|
-----
|
|
187
217
|
|
package/esm/logger.js
CHANGED
|
@@ -113,6 +113,9 @@ export class LoggerImpl {
|
|
|
113
113
|
}
|
|
114
114
|
this.reset();
|
|
115
115
|
}
|
|
116
|
+
with(properties) {
|
|
117
|
+
return new LoggerCtx(this, { ...properties });
|
|
118
|
+
}
|
|
116
119
|
filter(record) {
|
|
117
120
|
for (const filter of this.filters) {
|
|
118
121
|
if (!filter(record))
|
|
@@ -171,7 +174,7 @@ export class LoggerImpl {
|
|
|
171
174
|
};
|
|
172
175
|
this.emit(record, bypassSinks);
|
|
173
176
|
}
|
|
174
|
-
logLazily(level, callback) {
|
|
177
|
+
logLazily(level, callback, properties = {}) {
|
|
175
178
|
let msg = undefined;
|
|
176
179
|
this.emit({
|
|
177
180
|
category: this.category,
|
|
@@ -183,16 +186,16 @@ export class LoggerImpl {
|
|
|
183
186
|
return msg;
|
|
184
187
|
},
|
|
185
188
|
timestamp: Date.now(),
|
|
186
|
-
properties
|
|
189
|
+
properties,
|
|
187
190
|
});
|
|
188
191
|
}
|
|
189
|
-
logTemplate(level, messageTemplate, values) {
|
|
192
|
+
logTemplate(level, messageTemplate, values, properties = {}) {
|
|
190
193
|
this.emit({
|
|
191
194
|
category: this.category,
|
|
192
195
|
level,
|
|
193
196
|
message: renderMessage(messageTemplate, values),
|
|
194
197
|
timestamp: Date.now(),
|
|
195
|
-
properties
|
|
198
|
+
properties,
|
|
196
199
|
});
|
|
197
200
|
}
|
|
198
201
|
debug(message, ...values) {
|
|
@@ -251,6 +254,110 @@ export class LoggerImpl {
|
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* A logger implementation with contextual properties. Do not use this
|
|
259
|
+
* directly; use {@link Logger.with} instead. This class is exported
|
|
260
|
+
* for testing purposes.
|
|
261
|
+
*/
|
|
262
|
+
export class LoggerCtx {
|
|
263
|
+
constructor(logger, properties) {
|
|
264
|
+
Object.defineProperty(this, "logger", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
configurable: true,
|
|
267
|
+
writable: true,
|
|
268
|
+
value: void 0
|
|
269
|
+
});
|
|
270
|
+
Object.defineProperty(this, "properties", {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
configurable: true,
|
|
273
|
+
writable: true,
|
|
274
|
+
value: void 0
|
|
275
|
+
});
|
|
276
|
+
this.logger = logger;
|
|
277
|
+
this.properties = properties;
|
|
278
|
+
}
|
|
279
|
+
get category() {
|
|
280
|
+
return this.logger.category;
|
|
281
|
+
}
|
|
282
|
+
get parent() {
|
|
283
|
+
return this.logger.parent;
|
|
284
|
+
}
|
|
285
|
+
getChild(subcategory) {
|
|
286
|
+
return this.logger.getChild(subcategory).with(this.properties);
|
|
287
|
+
}
|
|
288
|
+
with(properties) {
|
|
289
|
+
return new LoggerCtx(this.logger, { ...this.properties, ...properties });
|
|
290
|
+
}
|
|
291
|
+
log(level, message, properties, bypassSinks) {
|
|
292
|
+
this.logger.log(level, message, typeof properties === "function"
|
|
293
|
+
? () => ({
|
|
294
|
+
...this.properties,
|
|
295
|
+
...properties(),
|
|
296
|
+
})
|
|
297
|
+
: { ...this.properties, ...properties }, bypassSinks);
|
|
298
|
+
}
|
|
299
|
+
logLazily(level, callback) {
|
|
300
|
+
this.logger.logLazily(level, callback, this.properties);
|
|
301
|
+
}
|
|
302
|
+
logTemplate(level, messageTemplate, values) {
|
|
303
|
+
this.logger.logTemplate(level, messageTemplate, values, this.properties);
|
|
304
|
+
}
|
|
305
|
+
debug(message, ...values) {
|
|
306
|
+
if (typeof message === "string") {
|
|
307
|
+
this.log("debug", message, (values[0] ?? {}));
|
|
308
|
+
}
|
|
309
|
+
else if (typeof message === "function") {
|
|
310
|
+
this.logLazily("debug", message);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this.logTemplate("debug", message, values);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
info(message, ...values) {
|
|
317
|
+
if (typeof message === "string") {
|
|
318
|
+
this.log("info", message, (values[0] ?? {}));
|
|
319
|
+
}
|
|
320
|
+
else if (typeof message === "function") {
|
|
321
|
+
this.logLazily("info", message);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
this.logTemplate("info", message, values);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
warn(message, ...values) {
|
|
328
|
+
if (typeof message === "string") {
|
|
329
|
+
this.log("warning", message, (values[0] ?? {}));
|
|
330
|
+
}
|
|
331
|
+
else if (typeof message === "function") {
|
|
332
|
+
this.logLazily("warning", message);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
this.logTemplate("warning", message, values);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
error(message, ...values) {
|
|
339
|
+
if (typeof message === "string") {
|
|
340
|
+
this.log("error", message, (values[0] ?? {}));
|
|
341
|
+
}
|
|
342
|
+
else if (typeof message === "function") {
|
|
343
|
+
this.logLazily("error", message);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
this.logTemplate("error", message, values);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
fatal(message, ...values) {
|
|
350
|
+
if (typeof message === "string") {
|
|
351
|
+
this.log("fatal", message, (values[0] ?? {}));
|
|
352
|
+
}
|
|
353
|
+
else if (typeof message === "function") {
|
|
354
|
+
this.logLazily("fatal", message);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
this.logTemplate("fatal", message, values);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
254
361
|
/**
|
|
255
362
|
* The meta logger. It is a logger with the category `["logtape", "meta"]`.
|
|
256
363
|
*/
|
package/package.json
CHANGED
package/script/config.js
CHANGED
|
@@ -23,7 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ConfigError =
|
|
26
|
+
exports.ConfigError = void 0;
|
|
27
|
+
exports.configure = configure;
|
|
28
|
+
exports.getConfig = getConfig;
|
|
29
|
+
exports.reset = reset;
|
|
30
|
+
exports.dispose = dispose;
|
|
27
31
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
28
32
|
const filter_js_1 = require("./filter.js");
|
|
29
33
|
const logger_js_1 = require("./logger.js");
|
|
@@ -156,7 +160,6 @@ async function configure(config) {
|
|
|
156
160
|
"misconfigured. To turn off this message, configure the meta logger " +
|
|
157
161
|
"with higher log levels than {dismissLevel}.", { metaLoggerCategory: ["logtape", "meta"], dismissLevel: "info" });
|
|
158
162
|
}
|
|
159
|
-
exports.configure = configure;
|
|
160
163
|
/**
|
|
161
164
|
* Get the current configuration, if any. Otherwise, `null`.
|
|
162
165
|
* @returns The current configuration, if any. Otherwise, `null`.
|
|
@@ -164,7 +167,6 @@ exports.configure = configure;
|
|
|
164
167
|
function getConfig() {
|
|
165
168
|
return currentConfig;
|
|
166
169
|
}
|
|
167
|
-
exports.getConfig = getConfig;
|
|
168
170
|
/**
|
|
169
171
|
* Reset the configuration. Mostly for testing purposes.
|
|
170
172
|
*/
|
|
@@ -174,7 +176,6 @@ async function reset() {
|
|
|
174
176
|
strongRefs.clear();
|
|
175
177
|
currentConfig = null;
|
|
176
178
|
}
|
|
177
|
-
exports.reset = reset;
|
|
178
179
|
/**
|
|
179
180
|
* Dispose of the disposables.
|
|
180
181
|
*/
|
|
@@ -189,7 +190,6 @@ async function dispose() {
|
|
|
189
190
|
}
|
|
190
191
|
await Promise.all(promises);
|
|
191
192
|
}
|
|
192
|
-
exports.dispose = dispose;
|
|
193
193
|
/**
|
|
194
194
|
* A configuration error.
|
|
195
195
|
*/
|
package/script/filesink.node.js
CHANGED
|
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.nodeDriver = void 0;
|
|
30
|
+
exports.getFileSink = getFileSink;
|
|
31
|
+
exports.getRotatingFileSink = getRotatingFileSink;
|
|
30
32
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
31
33
|
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
32
34
|
const fs_js_1 = __importDefault(require("./fs.js"));
|
|
@@ -65,7 +67,6 @@ function getFileSink(path, options = {}) {
|
|
|
65
67
|
}
|
|
66
68
|
return (0, sink_js_1.getFileSink)(path, { ...options, ...exports.nodeDriver });
|
|
67
69
|
}
|
|
68
|
-
exports.getFileSink = getFileSink;
|
|
69
70
|
/**
|
|
70
71
|
* Get a rotating file sink.
|
|
71
72
|
*
|
|
@@ -87,5 +88,4 @@ function getRotatingFileSink(path, options = {}) {
|
|
|
87
88
|
}
|
|
88
89
|
return (0, sink_js_1.getRotatingFileSink)(path, { ...options, ...exports.nodeDriver });
|
|
89
90
|
}
|
|
90
|
-
exports.getRotatingFileSink = getRotatingFileSink;
|
|
91
91
|
// cSpell: ignore filesink
|
package/script/filter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toFilter = toFilter;
|
|
4
|
+
exports.getLevelFilter = getLevelFilter;
|
|
4
5
|
/**
|
|
5
6
|
* Converts a {@link FilterLike} value to an actual {@link Filter}.
|
|
6
7
|
*
|
|
@@ -12,7 +13,6 @@ function toFilter(filter) {
|
|
|
12
13
|
return filter;
|
|
13
14
|
return getLevelFilter(filter);
|
|
14
15
|
}
|
|
15
|
-
exports.toFilter = toFilter;
|
|
16
16
|
/**
|
|
17
17
|
* Returns a filter that accepts log records with the specified level.
|
|
18
18
|
*
|
|
@@ -44,4 +44,3 @@ function getLevelFilter(level) {
|
|
|
44
44
|
return () => true;
|
|
45
45
|
throw new TypeError(`Invalid log level: ${level}.`);
|
|
46
46
|
}
|
|
47
|
-
exports.getLevelFilter = getLevelFilter;
|
package/script/formatter.js
CHANGED
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.defaultTextFormatter = defaultTextFormatter;
|
|
27
|
+
exports.defaultConsoleFormatter = defaultConsoleFormatter;
|
|
27
28
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
28
29
|
/**
|
|
29
30
|
* The severity level abbreviations.
|
|
@@ -79,7 +80,6 @@ function defaultTextFormatter(record) {
|
|
|
79
80
|
const category = record.category.join("\xb7");
|
|
80
81
|
return `${ts.toISOString().replace("T", " ").replace("Z", " +00:00")} [${levelAbbreviations[record.level]}] ${category}: ${msg}\n`;
|
|
81
82
|
}
|
|
82
|
-
exports.defaultTextFormatter = defaultTextFormatter;
|
|
83
83
|
/**
|
|
84
84
|
* The styles for the log level in the console.
|
|
85
85
|
*/
|
|
@@ -120,4 +120,3 @@ function defaultConsoleFormatter(record) {
|
|
|
120
120
|
...values,
|
|
121
121
|
];
|
|
122
122
|
}
|
|
123
|
-
exports.defaultConsoleFormatter = defaultConsoleFormatter;
|
package/script/level.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseLogLevel = parseLogLevel;
|
|
4
|
+
exports.isLogLevel = isLogLevel;
|
|
4
5
|
/**
|
|
5
6
|
* Parses a log level from a string.
|
|
6
7
|
*
|
|
@@ -21,7 +22,6 @@ function parseLogLevel(level) {
|
|
|
21
22
|
throw new TypeError(`Invalid log level: ${level}.`);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
exports.parseLogLevel = parseLogLevel;
|
|
25
25
|
/**
|
|
26
26
|
* Checks if a string is a valid log level. This function can be used as
|
|
27
27
|
* as a type guard to narrow the type of a string to a {@link LogLevel}.
|
|
@@ -41,4 +41,3 @@ function isLogLevel(level) {
|
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
exports.isLogLevel = isLogLevel;
|
package/script/logger.js
CHANGED
|
@@ -23,7 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.LoggerCtx = exports.LoggerImpl = void 0;
|
|
27
|
+
exports.getLogger = getLogger;
|
|
28
|
+
exports.parseMessageTemplate = parseMessageTemplate;
|
|
29
|
+
exports.renderMessage = renderMessage;
|
|
27
30
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
28
31
|
/**
|
|
29
32
|
* Get a logger with the given category.
|
|
@@ -40,7 +43,6 @@ const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
|
40
43
|
function getLogger(category = []) {
|
|
41
44
|
return LoggerImpl.getLogger(category);
|
|
42
45
|
}
|
|
43
|
-
exports.getLogger = getLogger;
|
|
44
46
|
/**
|
|
45
47
|
* The symbol for the global root logger.
|
|
46
48
|
*/
|
|
@@ -140,6 +142,9 @@ class LoggerImpl {
|
|
|
140
142
|
}
|
|
141
143
|
this.reset();
|
|
142
144
|
}
|
|
145
|
+
with(properties) {
|
|
146
|
+
return new LoggerCtx(this, { ...properties });
|
|
147
|
+
}
|
|
143
148
|
filter(record) {
|
|
144
149
|
for (const filter of this.filters) {
|
|
145
150
|
if (!filter(record))
|
|
@@ -198,7 +203,7 @@ class LoggerImpl {
|
|
|
198
203
|
};
|
|
199
204
|
this.emit(record, bypassSinks);
|
|
200
205
|
}
|
|
201
|
-
logLazily(level, callback) {
|
|
206
|
+
logLazily(level, callback, properties = {}) {
|
|
202
207
|
let msg = undefined;
|
|
203
208
|
this.emit({
|
|
204
209
|
category: this.category,
|
|
@@ -210,16 +215,16 @@ class LoggerImpl {
|
|
|
210
215
|
return msg;
|
|
211
216
|
},
|
|
212
217
|
timestamp: Date.now(),
|
|
213
|
-
properties
|
|
218
|
+
properties,
|
|
214
219
|
});
|
|
215
220
|
}
|
|
216
|
-
logTemplate(level, messageTemplate, values) {
|
|
221
|
+
logTemplate(level, messageTemplate, values, properties = {}) {
|
|
217
222
|
this.emit({
|
|
218
223
|
category: this.category,
|
|
219
224
|
level,
|
|
220
225
|
message: renderMessage(messageTemplate, values),
|
|
221
226
|
timestamp: Date.now(),
|
|
222
|
-
properties
|
|
227
|
+
properties,
|
|
223
228
|
});
|
|
224
229
|
}
|
|
225
230
|
debug(message, ...values) {
|
|
@@ -279,6 +284,111 @@ class LoggerImpl {
|
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
286
|
exports.LoggerImpl = LoggerImpl;
|
|
287
|
+
/**
|
|
288
|
+
* A logger implementation with contextual properties. Do not use this
|
|
289
|
+
* directly; use {@link Logger.with} instead. This class is exported
|
|
290
|
+
* for testing purposes.
|
|
291
|
+
*/
|
|
292
|
+
class LoggerCtx {
|
|
293
|
+
constructor(logger, properties) {
|
|
294
|
+
Object.defineProperty(this, "logger", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
configurable: true,
|
|
297
|
+
writable: true,
|
|
298
|
+
value: void 0
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(this, "properties", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
configurable: true,
|
|
303
|
+
writable: true,
|
|
304
|
+
value: void 0
|
|
305
|
+
});
|
|
306
|
+
this.logger = logger;
|
|
307
|
+
this.properties = properties;
|
|
308
|
+
}
|
|
309
|
+
get category() {
|
|
310
|
+
return this.logger.category;
|
|
311
|
+
}
|
|
312
|
+
get parent() {
|
|
313
|
+
return this.logger.parent;
|
|
314
|
+
}
|
|
315
|
+
getChild(subcategory) {
|
|
316
|
+
return this.logger.getChild(subcategory).with(this.properties);
|
|
317
|
+
}
|
|
318
|
+
with(properties) {
|
|
319
|
+
return new LoggerCtx(this.logger, { ...this.properties, ...properties });
|
|
320
|
+
}
|
|
321
|
+
log(level, message, properties, bypassSinks) {
|
|
322
|
+
this.logger.log(level, message, typeof properties === "function"
|
|
323
|
+
? () => ({
|
|
324
|
+
...this.properties,
|
|
325
|
+
...properties(),
|
|
326
|
+
})
|
|
327
|
+
: { ...this.properties, ...properties }, bypassSinks);
|
|
328
|
+
}
|
|
329
|
+
logLazily(level, callback) {
|
|
330
|
+
this.logger.logLazily(level, callback, this.properties);
|
|
331
|
+
}
|
|
332
|
+
logTemplate(level, messageTemplate, values) {
|
|
333
|
+
this.logger.logTemplate(level, messageTemplate, values, this.properties);
|
|
334
|
+
}
|
|
335
|
+
debug(message, ...values) {
|
|
336
|
+
if (typeof message === "string") {
|
|
337
|
+
this.log("debug", message, (values[0] ?? {}));
|
|
338
|
+
}
|
|
339
|
+
else if (typeof message === "function") {
|
|
340
|
+
this.logLazily("debug", message);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this.logTemplate("debug", message, values);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
info(message, ...values) {
|
|
347
|
+
if (typeof message === "string") {
|
|
348
|
+
this.log("info", message, (values[0] ?? {}));
|
|
349
|
+
}
|
|
350
|
+
else if (typeof message === "function") {
|
|
351
|
+
this.logLazily("info", message);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.logTemplate("info", message, values);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
warn(message, ...values) {
|
|
358
|
+
if (typeof message === "string") {
|
|
359
|
+
this.log("warning", message, (values[0] ?? {}));
|
|
360
|
+
}
|
|
361
|
+
else if (typeof message === "function") {
|
|
362
|
+
this.logLazily("warning", message);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
this.logTemplate("warning", message, values);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
error(message, ...values) {
|
|
369
|
+
if (typeof message === "string") {
|
|
370
|
+
this.log("error", message, (values[0] ?? {}));
|
|
371
|
+
}
|
|
372
|
+
else if (typeof message === "function") {
|
|
373
|
+
this.logLazily("error", message);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
this.logTemplate("error", message, values);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
fatal(message, ...values) {
|
|
380
|
+
if (typeof message === "string") {
|
|
381
|
+
this.log("fatal", message, (values[0] ?? {}));
|
|
382
|
+
}
|
|
383
|
+
else if (typeof message === "function") {
|
|
384
|
+
this.logLazily("fatal", message);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
this.logTemplate("fatal", message, values);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
exports.LoggerCtx = LoggerCtx;
|
|
282
392
|
/**
|
|
283
393
|
* The meta logger. It is a logger with the category `["logtape", "meta"]`.
|
|
284
394
|
*/
|
|
@@ -323,7 +433,6 @@ function parseMessageTemplate(template, properties) {
|
|
|
323
433
|
message.push(part);
|
|
324
434
|
return message;
|
|
325
435
|
}
|
|
326
|
-
exports.parseMessageTemplate = parseMessageTemplate;
|
|
327
436
|
/**
|
|
328
437
|
* Render a message template with values.
|
|
329
438
|
* @param template The message template.
|
|
@@ -340,4 +449,3 @@ function renderMessage(template, values) {
|
|
|
340
449
|
}
|
|
341
450
|
return args;
|
|
342
451
|
}
|
|
343
|
-
exports.renderMessage = renderMessage;
|
package/script/sink.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withFilter = withFilter;
|
|
4
|
+
exports.getStreamSink = getStreamSink;
|
|
5
|
+
exports.getConsoleSink = getConsoleSink;
|
|
6
|
+
exports.getFileSink = getFileSink;
|
|
7
|
+
exports.getRotatingFileSink = getRotatingFileSink;
|
|
4
8
|
const filter_js_1 = require("./filter.js");
|
|
5
9
|
const formatter_js_1 = require("./formatter.js");
|
|
6
10
|
/**
|
|
@@ -24,7 +28,6 @@ function withFilter(sink, filter) {
|
|
|
24
28
|
sink(record);
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
exports.withFilter = withFilter;
|
|
28
31
|
/**
|
|
29
32
|
* A factory that returns a sink that writes to a {@link WritableStream}.
|
|
30
33
|
*
|
|
@@ -66,7 +69,6 @@ function getStreamSink(stream, options = {}) {
|
|
|
66
69
|
};
|
|
67
70
|
return sink;
|
|
68
71
|
}
|
|
69
|
-
exports.getStreamSink = getStreamSink;
|
|
70
72
|
/**
|
|
71
73
|
* A console sink factory that returns a sink that logs to the console.
|
|
72
74
|
*
|
|
@@ -91,7 +93,6 @@ function getConsoleSink(options = {}) {
|
|
|
91
93
|
throw new TypeError(`Invalid log level: ${record.level}.`);
|
|
92
94
|
};
|
|
93
95
|
}
|
|
94
|
-
exports.getConsoleSink = getConsoleSink;
|
|
95
96
|
/**
|
|
96
97
|
* Get a platform-independent file sink.
|
|
97
98
|
*
|
|
@@ -112,7 +113,6 @@ function getFileSink(path, options) {
|
|
|
112
113
|
sink[Symbol.dispose] = () => options.closeSync(fd);
|
|
113
114
|
return sink;
|
|
114
115
|
}
|
|
115
|
-
exports.getFileSink = getFileSink;
|
|
116
116
|
/**
|
|
117
117
|
* Get a platform-independent rotating file sink.
|
|
118
118
|
*
|
|
@@ -163,4 +163,3 @@ function getRotatingFileSink(path, options) {
|
|
|
163
163
|
sink[Symbol.dispose] = () => options.closeSync(fd);
|
|
164
164
|
return sink;
|
|
165
165
|
}
|
|
166
|
-
exports.getRotatingFileSink = getRotatingFileSink;
|
package/types/filesink.node.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesink.node.d.ts","sourceRoot":"","sources":["../src/filesink.node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filesink.node.d.ts","sourceRoot":"","sources":["../src/filesink.node.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,IAAI,EACV,MAAM,WAAW,CAAC;AAKnB;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,sBAAsB,CAAC,MAAM,GAAG,IAAI,CAW1D,CAAC;AAEJ;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,IAAI,GAAG,UAAU,CAKnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,IAAI,GAAG,UAAU,CAKnB"}
|
package/types/fs.d.ts
CHANGED
package/types/logger.d.ts
CHANGED
|
@@ -44,6 +44,33 @@ export interface Logger {
|
|
|
44
44
|
* @returns The child logger.
|
|
45
45
|
*/
|
|
46
46
|
getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
|
|
47
|
+
/**
|
|
48
|
+
* Get a logger with contextual properties. This is useful for
|
|
49
|
+
* log multiple messages with the shared set of properties.
|
|
50
|
+
*
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const logger = getLogger("category");
|
|
53
|
+
* const ctx = logger.with({ foo: 123, bar: "abc" });
|
|
54
|
+
* ctx.info("A message with {foo} and {bar}.");
|
|
55
|
+
* ctx.warn("Another message with {foo}, {bar}, and {baz}.", { baz: true });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* The above code is equivalent to:
|
|
59
|
+
*
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const logger = getLogger("category");
|
|
62
|
+
* logger.info("A message with {foo} and {bar}.", { foo: 123, bar: "abc" });
|
|
63
|
+
* logger.warn(
|
|
64
|
+
* "Another message with {foo}, {bar}, and {baz}.",
|
|
65
|
+
* { foo: 123, bar: "abc", baz: true },
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param properties
|
|
70
|
+
* @returns
|
|
71
|
+
* @since 0.5.0
|
|
72
|
+
*/
|
|
73
|
+
with(properties: Record<string, unknown>): Logger;
|
|
47
74
|
/**
|
|
48
75
|
* Log a debug message. Use this as a template string prefix.
|
|
49
76
|
*
|
|
@@ -334,10 +361,33 @@ export declare class LoggerImpl implements Logger {
|
|
|
334
361
|
* filters from the logger and all its descendants.
|
|
335
362
|
*/
|
|
336
363
|
resetDescendants(): void;
|
|
364
|
+
with(properties: Record<string, unknown>): Logger;
|
|
337
365
|
filter(record: LogRecord): boolean;
|
|
338
366
|
getSinks(): Iterable<Sink>;
|
|
339
367
|
emit(record: LogRecord, bypassSinks?: Set<Sink>): void;
|
|
340
368
|
log(level: LogLevel, message: string, properties: Record<string, unknown> | (() => Record<string, unknown>), bypassSinks?: Set<Sink>): void;
|
|
369
|
+
logLazily(level: LogLevel, callback: LogCallback, properties?: Record<string, unknown>): void;
|
|
370
|
+
logTemplate(level: LogLevel, messageTemplate: TemplateStringsArray, values: unknown[], properties?: Record<string, unknown>): void;
|
|
371
|
+
debug(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
|
372
|
+
info(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
|
373
|
+
warn(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
|
374
|
+
error(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
|
375
|
+
fatal(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* A logger implementation with contextual properties. Do not use this
|
|
379
|
+
* directly; use {@link Logger.with} instead. This class is exported
|
|
380
|
+
* for testing purposes.
|
|
381
|
+
*/
|
|
382
|
+
export declare class LoggerCtx implements Logger {
|
|
383
|
+
logger: LoggerImpl;
|
|
384
|
+
properties: Record<string, unknown>;
|
|
385
|
+
constructor(logger: LoggerImpl, properties: Record<string, unknown>);
|
|
386
|
+
get category(): readonly string[];
|
|
387
|
+
get parent(): Logger | null;
|
|
388
|
+
getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
|
|
389
|
+
with(properties: Record<string, unknown>): Logger;
|
|
390
|
+
log(level: LogLevel, message: string, properties: Record<string, unknown> | (() => Record<string, unknown>), bypassSinks?: Set<Sink>): void;
|
|
341
391
|
logLazily(level: LogLevel, callback: LogCallback): void;
|
|
342
392
|
logTemplate(level: LogLevel, messageTemplate: TemplateStringsArray, values: unknown[]): void;
|
|
343
393
|
debug(message: TemplateStringsArray | string | LogCallback, ...values: unknown[]): void;
|
package/types/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,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,CACN,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAA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B,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAUP,IAAI,CACF,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAcP,KAAK,CACH,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;IAUP,KAAK,CACH,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,WAAW,EACpD,GAAG,MAAM,EAAE,OAAO,EAAE,GACnB,IAAI;CASR;AAOD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,SAAS,OAAO,EAAE,CA8BpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,SAAS,OAAO,EAAE,GACzB,OAAO,EAAE,CAOX"}
|
package/types/sink.d.ts
CHANGED
package/types/sink.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../src/sink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../src/sink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,KAAK,gBAAgB,EAGrB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CA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