@logtape/logtape 0.5.0-dev.44 → 0.5.0-dev.53
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 +0 -4
- package/esm/_dnt.shims.js +1 -5
- package/esm/filesink.node.js +16 -11
- package/esm/formatter.js +12 -6
- package/esm/fs.js +20 -0
- package/esm/logger.js +8 -3
- package/package.json +1 -1
- package/script/_dnt.shims.js +2 -7
- package/script/filesink.node.js +16 -11
- package/script/formatter.js +35 -6
- package/script/fs.js +16 -0
- package/script/logger.js +8 -3
- package/types/_dnt.shims.d.ts +1 -9
- package/types/_dnt.shims.d.ts.map +1 -1
- package/types/_dnt.test_shims.d.ts.map +1 -1
- package/types/filesink.node.d.ts +1 -1
- package/types/filesink.node.d.ts.map +1 -1
- package/types/formatter.d.ts.map +1 -1
- package/types/fs.d.ts +3 -0
- package/types/fs.d.ts.map +1 -0
- package/types/logger.d.ts +1 -1
- package/types/logger.d.ts.map +1 -1
- package/types/sink.d.ts +1 -4
- package/types/sink.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -8,10 +8,6 @@ LogTape
|
|
|
8
8
|
[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
|
|
9
9
|
[![Codecov][Codecov badge]][Codecov]
|
|
10
10
|
|
|
11
|
-
> [!NOTE]
|
|
12
|
-
> LogTape is still in the early stage of development. The API is not stable
|
|
13
|
-
> yet. Please be careful when using it in production.
|
|
14
|
-
|
|
15
11
|
LogTape is a logging library for JavaScript and TypeScript. It provides a
|
|
16
12
|
simple and flexible logging system that is easy to use and easy to extend.
|
|
17
13
|
The highlights of LogTape are:
|
package/esm/_dnt.shims.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { WritableStream } from "node:stream/web";
|
|
3
|
-
const dntGlobals = {
|
|
4
|
-
WritableStream,
|
|
5
|
-
};
|
|
1
|
+
const dntGlobals = {};
|
|
6
2
|
export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
7
3
|
function createMergeProxy(baseObj, extObj) {
|
|
8
4
|
return new Proxy(baseObj, {
|
package/esm/filesink.node.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import * as dntShim from "./_dnt.shims.js";
|
|
2
|
-
|
|
2
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
3
|
+
import fsMod from "./fs.js";
|
|
3
4
|
import { webDriver } from "./filesink.web.js";
|
|
4
5
|
import { getFileSink as getBaseFileSink, getRotatingFileSink as getBaseRotatingFileSink, } from "./sink.js";
|
|
6
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
7
|
+
const fs = fsMod;
|
|
5
8
|
/**
|
|
6
9
|
* A Node.js-specific file sink driver.
|
|
7
10
|
*/
|
|
8
|
-
export const nodeDriver =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export const nodeDriver = fs == null
|
|
12
|
+
? webDriver
|
|
13
|
+
: {
|
|
14
|
+
openSync(path) {
|
|
15
|
+
return fs.openSync(path, "a");
|
|
16
|
+
},
|
|
17
|
+
writeSync: fs.writeSync,
|
|
18
|
+
flushSync: fs.fsyncSync,
|
|
19
|
+
closeSync: fs.closeSync,
|
|
20
|
+
statSync: fs.statSync,
|
|
21
|
+
renameSync: fs.renameSync,
|
|
22
|
+
};
|
|
18
23
|
/**
|
|
19
24
|
* Get a file sink.
|
|
20
25
|
*
|
package/esm/formatter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as dntShim from "./_dnt.shims.js";
|
|
1
2
|
/**
|
|
2
3
|
* The severity level abbreviations.
|
|
3
4
|
*/
|
|
@@ -16,15 +17,20 @@ const levelAbbreviations = {
|
|
|
16
17
|
* @param value The value to inspect.
|
|
17
18
|
* @returns The string representation of the value.
|
|
18
19
|
*/
|
|
19
|
-
const inspect =
|
|
20
|
-
|
|
20
|
+
const inspect =
|
|
21
|
+
// @ts-ignore: Deno global
|
|
22
|
+
"Deno" in dntShim.dntGlobalThis && "inspect" in globalThis.Deno &&
|
|
23
|
+
// @ts-ignore: Deno global
|
|
21
24
|
typeof globalThis.Deno.inspect === "function"
|
|
25
|
+
// @ts-ignore: Deno global
|
|
22
26
|
? globalThis.Deno.inspect
|
|
23
|
-
:
|
|
27
|
+
// @ts-ignore: Node.js global
|
|
28
|
+
: "util" in dntShim.dntGlobalThis && "inspect" in globalThis.util &&
|
|
29
|
+
// @ts-ignore: Node.js global
|
|
24
30
|
globalThis.util.inspect === "function"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
// @ts-ignore: Node.js global
|
|
32
|
+
? globalThis.util.inspect
|
|
33
|
+
: JSON.stringify;
|
|
28
34
|
/**
|
|
29
35
|
* The default text formatter. This formatter formats log records as follows:
|
|
30
36
|
*
|
package/esm/fs.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let fs = null;
|
|
2
|
+
if (
|
|
3
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
+
"node" in globalThis.process.versions &&
|
|
5
|
+
typeof globalThis.caches === "undefined" &&
|
|
6
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
+
"Bun" in globalThis
|
|
8
|
+
) {
|
|
9
|
+
try {
|
|
10
|
+
fs = await import("node" + ":fs");
|
|
11
|
+
} catch (e) {
|
|
12
|
+
if (e instanceof TypeError) {
|
|
13
|
+
fs = null;
|
|
14
|
+
} else {
|
|
15
|
+
throw e;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default fs;
|
package/esm/logger.js
CHANGED
|
@@ -77,10 +77,15 @@ export class LoggerImpl {
|
|
|
77
77
|
}
|
|
78
78
|
getChild(subcategory) {
|
|
79
79
|
const name = typeof subcategory === "string" ? subcategory : subcategory[0];
|
|
80
|
-
|
|
80
|
+
const childRef = this.children[name];
|
|
81
|
+
let child = childRef instanceof LoggerImpl
|
|
82
|
+
? childRef
|
|
83
|
+
: childRef?.deref();
|
|
81
84
|
if (child == null) {
|
|
82
85
|
child = new LoggerImpl(this, [...this.category, name]);
|
|
83
|
-
this.children[name] =
|
|
86
|
+
this.children[name] = "WeakRef" in dntShim.dntGlobalThis
|
|
87
|
+
? new WeakRef(child)
|
|
88
|
+
: child;
|
|
84
89
|
}
|
|
85
90
|
if (typeof subcategory === "string" || subcategory.length === 1) {
|
|
86
91
|
return child;
|
|
@@ -102,7 +107,7 @@ export class LoggerImpl {
|
|
|
102
107
|
*/
|
|
103
108
|
resetDescendants() {
|
|
104
109
|
for (const child of Object.values(this.children)) {
|
|
105
|
-
const logger = child.deref();
|
|
110
|
+
const logger = child instanceof LoggerImpl ? child : child.deref();
|
|
106
111
|
if (logger != null)
|
|
107
112
|
logger.resetDescendants();
|
|
108
113
|
}
|
package/package.json
CHANGED
package/script/_dnt.shims.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dntGlobalThis =
|
|
4
|
-
const
|
|
5
|
-
var web_2 = require("node:stream/web");
|
|
6
|
-
Object.defineProperty(exports, "WritableStream", { enumerable: true, get: function () { return web_2.WritableStream; } });
|
|
7
|
-
const dntGlobals = {
|
|
8
|
-
WritableStream: web_1.WritableStream,
|
|
9
|
-
};
|
|
3
|
+
exports.dntGlobalThis = void 0;
|
|
4
|
+
const dntGlobals = {};
|
|
10
5
|
exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
11
6
|
function createMergeProxy(baseObj, extObj) {
|
|
12
7
|
return new Proxy(baseObj, {
|
package/script/filesink.node.js
CHANGED
|
@@ -28,22 +28,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.getRotatingFileSink = exports.getFileSink = exports.nodeDriver = void 0;
|
|
30
30
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
31
|
-
|
|
31
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
32
|
+
const fs_js_1 = __importDefault(require("./fs.js"));
|
|
32
33
|
const filesink_web_js_1 = require("./filesink.web.js");
|
|
33
34
|
const sink_js_1 = require("./sink.js");
|
|
35
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
36
|
+
const fs = fs_js_1.default;
|
|
34
37
|
/**
|
|
35
38
|
* A Node.js-specific file sink driver.
|
|
36
39
|
*/
|
|
37
|
-
exports.nodeDriver =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
exports.nodeDriver = fs == null
|
|
41
|
+
? filesink_web_js_1.webDriver
|
|
42
|
+
: {
|
|
43
|
+
openSync(path) {
|
|
44
|
+
return fs.openSync(path, "a");
|
|
45
|
+
},
|
|
46
|
+
writeSync: fs.writeSync,
|
|
47
|
+
flushSync: fs.fsyncSync,
|
|
48
|
+
closeSync: fs.closeSync,
|
|
49
|
+
statSync: fs.statSync,
|
|
50
|
+
renameSync: fs.renameSync,
|
|
51
|
+
};
|
|
47
52
|
/**
|
|
48
53
|
* Get a file sink.
|
|
49
54
|
*
|
package/script/formatter.js
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.defaultConsoleFormatter = exports.defaultTextFormatter = void 0;
|
|
27
|
+
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
4
28
|
/**
|
|
5
29
|
* The severity level abbreviations.
|
|
6
30
|
*/
|
|
@@ -19,15 +43,20 @@ const levelAbbreviations = {
|
|
|
19
43
|
* @param value The value to inspect.
|
|
20
44
|
* @returns The string representation of the value.
|
|
21
45
|
*/
|
|
22
|
-
const inspect =
|
|
23
|
-
|
|
46
|
+
const inspect =
|
|
47
|
+
// @ts-ignore: Deno global
|
|
48
|
+
"Deno" in dntShim.dntGlobalThis && "inspect" in globalThis.Deno &&
|
|
49
|
+
// @ts-ignore: Deno global
|
|
24
50
|
typeof globalThis.Deno.inspect === "function"
|
|
51
|
+
// @ts-ignore: Deno global
|
|
25
52
|
? globalThis.Deno.inspect
|
|
26
|
-
:
|
|
53
|
+
// @ts-ignore: Node.js global
|
|
54
|
+
: "util" in dntShim.dntGlobalThis && "inspect" in globalThis.util &&
|
|
55
|
+
// @ts-ignore: Node.js global
|
|
27
56
|
globalThis.util.inspect === "function"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
57
|
+
// @ts-ignore: Node.js global
|
|
58
|
+
? globalThis.util.inspect
|
|
59
|
+
: JSON.stringify;
|
|
31
60
|
/**
|
|
32
61
|
* The default text formatter. This formatter formats log records as follows:
|
|
33
62
|
*
|
package/script/fs.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let fs = null;
|
|
2
|
+
if (
|
|
3
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
+
"node" in globalThis.process.versions &&
|
|
5
|
+
typeof globalThis.caches === "undefined" &&
|
|
6
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
+
"Bun" in globalThis
|
|
8
|
+
) {
|
|
9
|
+
try {
|
|
10
|
+
fs = require("node" + ":fs");
|
|
11
|
+
} catch (_) {
|
|
12
|
+
fs = null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = fs;
|
package/script/logger.js
CHANGED
|
@@ -104,10 +104,15 @@ class LoggerImpl {
|
|
|
104
104
|
}
|
|
105
105
|
getChild(subcategory) {
|
|
106
106
|
const name = typeof subcategory === "string" ? subcategory : subcategory[0];
|
|
107
|
-
|
|
107
|
+
const childRef = this.children[name];
|
|
108
|
+
let child = childRef instanceof LoggerImpl
|
|
109
|
+
? childRef
|
|
110
|
+
: childRef?.deref();
|
|
108
111
|
if (child == null) {
|
|
109
112
|
child = new LoggerImpl(this, [...this.category, name]);
|
|
110
|
-
this.children[name] =
|
|
113
|
+
this.children[name] = "WeakRef" in dntShim.dntGlobalThis
|
|
114
|
+
? new WeakRef(child)
|
|
115
|
+
: child;
|
|
111
116
|
}
|
|
112
117
|
if (typeof subcategory === "string" || subcategory.length === 1) {
|
|
113
118
|
return child;
|
|
@@ -129,7 +134,7 @@ class LoggerImpl {
|
|
|
129
134
|
*/
|
|
130
135
|
resetDescendants() {
|
|
131
136
|
for (const child of Object.values(this.children)) {
|
|
132
|
-
const logger = child.deref();
|
|
137
|
+
const logger = child instanceof LoggerImpl ? child : child.deref();
|
|
133
138
|
if (logger != null)
|
|
134
139
|
logger.resetDescendants();
|
|
135
140
|
}
|
package/types/_dnt.shims.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { WritableStream } from "node:stream/web";
|
|
3
|
-
export { WritableStream } from "node:stream/web";
|
|
4
|
-
export declare const dntGlobalThis: Omit<typeof globalThis, "WritableStream"> & {
|
|
5
|
-
WritableStream: {
|
|
6
|
-
new <W = any>(underlyingSink?: import("stream/web").UnderlyingSink<W> | undefined, strategy?: import("stream/web").QueuingStrategy<W> | undefined): WritableStream<W>;
|
|
7
|
-
prototype: WritableStream<any>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
1
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, never>;
|
|
10
2
|
//# sourceMappingURL=_dnt.shims.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
|
package/types/filesink.node.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type FileSinkOptions, type RotatingFileSinkDriver, type RotatingFileSin
|
|
|
3
3
|
/**
|
|
4
4
|
* A Node.js-specific file sink driver.
|
|
5
5
|
*/
|
|
6
|
-
export declare const nodeDriver: RotatingFileSinkDriver<number>;
|
|
6
|
+
export declare const nodeDriver: RotatingFileSinkDriver<number | void>;
|
|
7
7
|
/**
|
|
8
8
|
* Get a file sink.
|
|
9
9
|
*
|
|
@@ -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/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC;AAoC1D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAW9D;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,OAAO,EAAE,CAAC;AAazE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CA2B7E"}
|
package/types/fs.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.js"],"names":[],"mappings":""}
|
package/types/logger.d.ts
CHANGED
|
@@ -318,7 +318,7 @@ export declare function getLogger(category?: string | readonly string[]): Logger
|
|
|
318
318
|
*/
|
|
319
319
|
export declare class LoggerImpl implements Logger {
|
|
320
320
|
readonly parent: LoggerImpl | null;
|
|
321
|
-
readonly children: Record<string, WeakRef<LoggerImpl>>;
|
|
321
|
+
readonly children: Record<string, LoggerImpl | WeakRef<LoggerImpl>>;
|
|
322
322
|
readonly category: readonly string[];
|
|
323
323
|
readonly sinks: Sink[];
|
|
324
324
|
readonly filters: Filter[];
|
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;IAEr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G,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
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
import * as dntShim from "./_dnt.shims.js";
|
|
5
2
|
import { type FilterLike } from "./filter.js";
|
|
6
3
|
import { type ConsoleFormatter, type TextFormatter } from "./formatter.js";
|
|
7
4
|
import type { LogRecord } from "./record.js";
|
|
@@ -69,7 +66,7 @@ export interface StreamSinkOptions {
|
|
|
69
66
|
* @param options The options for the sink.
|
|
70
67
|
* @returns A sink that writes to the stream.
|
|
71
68
|
*/
|
|
72
|
-
export declare function getStreamSink(stream:
|
|
69
|
+
export declare function getStreamSink(stream: WritableStream, options?: StreamSinkOptions): Sink & AsyncDisposable;
|
|
73
70
|
/**
|
|
74
71
|
* Options for the {@link getConsoleSink} function.
|
|
75
72
|
*/
|
package/types/sink.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../src/sink.ts"],"names":[],"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