@monochromatic-dev/module-logger 0.2.0 → 0.3.0
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/CHANGELOG.md +11 -0
- package/README.md +33 -8
- package/dist/final/neutral/browser.d.mts +60 -0
- package/dist/final/neutral/browser.mjs +1 -0
- package/dist/final/neutral/index.d.mts +360 -594
- package/dist/final/neutral/index.mjs +2 -3
- package/dist/final/neutral/indexed-db-hsIfv7Cv.mjs +2 -0
- package/dist/final/neutral/types-BkkBXgY3.d.mts +76 -0
- package/dist/final/node/file-CRGb1hDK.mjs +1 -0
- package/dist/final/node/index.d.mts +360 -594
- package/dist/final/node/index.mjs +3 -3
- package/dist/final/node/node.d.mts +103 -0
- package/dist/final/node/node.mjs +1 -0
- package/dist/final/node/types-BkkBXgY3.d.mts +76 -0
- package/package.json +18 -4
- package/src/artifact-platform-split.unit.test.ts +140 -0
- package/src/browser.ts +14 -0
- package/src/create-logger.ts +183 -183
- package/src/create-logger.unit.test.ts +112 -112
- package/src/default-sinks.neutral.ts +34 -0
- package/src/default-sinks.node.ts +32 -0
- package/src/error-format.ts +23 -23
- package/src/logger.ts +23 -50
- package/src/node.ts +23 -0
- package/src/sink/console-control-chars.ts +64 -64
- package/src/sink/console-control-chars.unit.test.ts +14 -14
- package/src/sink/console.ts +194 -194
- package/src/sink/console.unit.test.ts +18 -18
- package/src/sink/file.ts +136 -140
- package/src/sink/file.unit.test.ts +19 -26
- package/src/sink/index.ts +4 -7
- package/src/sink/indexed-db-util.ts +42 -42
- package/src/sink/indexed-db.browser.test.ts +7 -7
- package/src/sink/indexed-db.ts +109 -109
- package/src/sink/indexed-db.unit.test.ts +5 -13
- package/src/sink/local-storage-key.ts +73 -73
- package/src/sink/local-storage-key.unit.test.ts +8 -8
- package/src/sink/local-storage-quota.ts +37 -37
- package/src/sink/local-storage-quota.unit.test.ts +8 -8
- package/src/sink/local-storage-store.ts +113 -113
- package/src/sink/local-storage-store.unit.test.ts +35 -35
- package/src/sink/local-storage.ts +72 -72
- package/src/sink/local-storage.unit.test.ts +27 -27
- package/src/sink/noop.ts +20 -20
- package/src/sink/noop.unit.test.ts +1 -1
- package/src/sink/opfs.browser.test.ts +7 -7
- package/src/sink/opfs.ts +62 -62
- package/src/sink/opfs.unit.test.ts +5 -13
- package/src/sink/record-buffer.ts +84 -84
- package/src/sink/record-buffer.unit.test.ts +20 -20
- package/src/sink/session-storage-quota.ts +34 -34
- package/src/sink/session-storage-quota.unit.test.ts +8 -8
- package/src/sink/session-storage-store.ts +72 -72
- package/src/sink/session-storage.ts +48 -48
- package/src/sink/session-storage.unit.test.ts +39 -39
- package/src/sink/web-storage-quota-error.ts +22 -22
- package/src/sink/web-storage-quota-error.unit.test.ts +2 -2
- package/src/sink/web-storage-runtime.ts +24 -24
- package/src/startup.unit.test.ts +18 -18
- package/src/tagged.ts +35 -35
- package/src/tagged.unit.test.ts +8 -8
- package/src/types.ts +39 -39
|
@@ -9,23 +9,23 @@ import type {
|
|
|
9
9
|
} from '../types.ts';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Node CLI flag that backs `localStorage` with a file; without it Node 26
|
|
13
|
+
leaves `globalThis.localStorage` undefined and prints an
|
|
14
|
+
`ExperimentalWarning` on stderr the moment the getter is touched.
|
|
15
15
|
*/
|
|
16
16
|
const NODE_LOCALSTORAGE_FLAG = '--localstorage-file';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
Reports whether this is a flagless plain-Node process, where
|
|
20
|
+
`globalThis.localStorage` is undefined and merely touching the getter
|
|
21
|
+
prints Node's ExperimentalWarning on stderr for every consumer, so `verify`
|
|
22
|
+
skips the probe without any access. The flag is honored both on the command
|
|
23
|
+
line (`process.execArgv`) and through `NODE_OPTIONS` (verified on Node 26;
|
|
24
|
+
`execArgv` does not echo `NODE_OPTIONS` flags, so both are checked). A DOM
|
|
25
|
+
host (such as an Electron renderer, which carries `process.versions.node`
|
|
26
|
+
alongside a real `localStorage`) is exempt and probes normally.
|
|
27
|
+
|
|
28
|
+
@returns Whether the probe must be skipped because Node would only warn.
|
|
29
29
|
*/
|
|
30
30
|
function nodeWithoutLocalStorageFile(): boolean {
|
|
31
31
|
if (detectWebStorageRuntime() !== 'node')
|
|
@@ -33,55 +33,55 @@ function nodeWithoutLocalStorageFile(): boolean {
|
|
|
33
33
|
if ('document' in globalThis)
|
|
34
34
|
return false;
|
|
35
35
|
/**
|
|
36
|
-
|
|
36
|
+
Whether the backing-file flag reached this process on the command line.
|
|
37
37
|
*/
|
|
38
38
|
const flaggedInExecArgv = process.execArgv
|
|
39
39
|
.some(function startsWithFlag(argument: string,) {
|
|
40
40
|
return argument.startsWith(NODE_LOCALSTORAGE_FLAG,);
|
|
41
41
|
},);
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
Raw `NODE_OPTIONS` value, absent when the variable is unset; `execArgv`
|
|
44
|
+
does not echo flags arriving through it, so it is scanned separately.
|
|
45
45
|
*/
|
|
46
46
|
const nodeOptions = process.env
|
|
47
47
|
.NODE_OPTIONS;
|
|
48
48
|
/**
|
|
49
|
-
|
|
49
|
+
Whether the backing-file flag reached this process through `NODE_OPTIONS`.
|
|
50
50
|
*/
|
|
51
51
|
const flaggedInNodeOptions = (nodeOptions ?? '').includes(NODE_LOCALSTORAGE_FLAG,);
|
|
52
52
|
return !(flaggedInExecArgv || flaggedInNodeOptions);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
56
|
+
Verifies localStorage actually persists data. Stateless: the logger calls
|
|
57
|
+
this once per sink at startup and owns the resulting availability, so no
|
|
58
|
+
verified/available flag is kept here.
|
|
59
|
+
|
|
60
|
+
Election is by probe alone: any runtime whose `localStorage` round-trips
|
|
61
|
+
(browsers, Deno, Node launched with `--localstorage-file`) keeps the sink.
|
|
62
|
+
The one short-circuit, {@link nodeWithoutLocalStorageFile}, returns the
|
|
63
|
+
same `false` the probe would and exists only to keep Node's access warning
|
|
64
|
+
off every consumer's stderr, not to gate by runtime brand.
|
|
65
|
+
|
|
66
|
+
@returns Whether localStorage is available and round-trips a probe write.
|
|
67
|
+
|
|
68
|
+
@example
|
|
69
|
+
```ts
|
|
70
|
+
if (await verifyLocalStorage()) {
|
|
71
|
+
// localStorage usable
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
74
|
*/
|
|
75
75
|
function verifyLocalStorage(): Promise<boolean> {
|
|
76
76
|
if (nodeWithoutLocalStorageFile())
|
|
77
77
|
return Promise.resolve(false,);
|
|
78
78
|
try {
|
|
79
79
|
/**
|
|
80
|
-
|
|
80
|
+
Sentinel key used only for the probe write/read; removed afterward to avoid polluting real log entries.
|
|
81
81
|
*/
|
|
82
82
|
const testKey = '__monochromatic_verify__';
|
|
83
83
|
/**
|
|
84
|
-
|
|
84
|
+
Timestamp-based probe value so concurrent verifications never read each other's writes.
|
|
85
85
|
*/
|
|
86
86
|
const testValue = `test-${Date.now()}`;
|
|
87
87
|
globalThis.localStorage
|
|
@@ -90,7 +90,7 @@ function verifyLocalStorage(): Promise<boolean> {
|
|
|
90
90
|
testValue,
|
|
91
91
|
);
|
|
92
92
|
/**
|
|
93
|
-
|
|
93
|
+
Probe value read back from storage; equality with `testValue` proves writes actually persist.
|
|
94
94
|
*/
|
|
95
95
|
const readBack = globalThis.localStorage
|
|
96
96
|
.getItem(testKey,);
|
|
@@ -109,49 +109,49 @@ function verifyLocalStorage(): Promise<boolean> {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
Builds a localStorage sink that buffers serialized records through the
|
|
113
|
+
shared {@link createRecordBuffer} policy and persists each newline-joined
|
|
114
|
+
JSONL batch under a run-scoped counter-incremented key through
|
|
115
|
+
{@link createLocalStorageStore}. One uniform write path runs on every
|
|
116
|
+
runtime; no per-runtime mode exists. Flush triggers (32 KiB in-write cap,
|
|
117
|
+
`warn`-or-worse severity, 250 ms quiet-period deadline, page lifecycle,
|
|
118
|
+
and the `flush` hook) are the buffer's; see {@link createRecordBuffer}.
|
|
119
|
+
|
|
120
|
+
Unlike the sessionStorage sink, whose store dies with the tab, this sink's
|
|
121
|
+
batches survive tab close and browser restart, bounded by oldest-first
|
|
122
|
+
eviction at half the localStorage quota; that makes it the web storage sink
|
|
123
|
+
whose records remain inspectable after a full crash-and-restart.
|
|
124
|
+
|
|
125
|
+
@returns Sink backed by web `localStorage`.
|
|
126
|
+
|
|
127
|
+
@example
|
|
128
|
+
```ts
|
|
129
|
+
const { logger } = createLogger({ sinks: [createLocalStorageSink()] });
|
|
130
|
+
logger.info('user signed in'); // buffered
|
|
131
|
+
logger.warn('quota near'); // flushes both records in one batch
|
|
132
|
+
```
|
|
133
133
|
*/
|
|
134
134
|
export function createLocalStorageSink(): Sink {
|
|
135
135
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
Persistence engine owning run identity, key allocation, prior-run
|
|
137
|
+
adoption, footprint accounting, and quota eviction; the buffer decides
|
|
138
|
+
when a batch is handed to it.
|
|
139
139
|
*/
|
|
140
140
|
const store = createLocalStorageStore();
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
Shared buffering stage; every flush trigger lands one joined batch in the
|
|
144
|
+
persistence engine synchronously.
|
|
145
145
|
*/
|
|
146
146
|
const buffer = createRecordBuffer({ onFlush: store.persist, },);
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
Buffers a log record through the shared policy; see
|
|
150
|
+
{@link createRecordBuffer} for the flush triggers.
|
|
151
|
+
|
|
152
|
+
@param record - Log record to buffer and eventually persist.
|
|
153
|
+
|
|
154
|
+
@mutates record - `JSON.stringify` may invoke `toJSON`, getters, or proxy traps.
|
|
155
155
|
*/
|
|
156
156
|
function write(record: {
|
|
157
157
|
level: Level;
|
|
@@ -166,8 +166,8 @@ export function createLocalStorageSink(): Sink {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
Drains the buffer into the persistence engine; the drain is synchronous,
|
|
170
|
+
so the batch has landed by the time the resolved promise is observed.
|
|
171
171
|
*/
|
|
172
172
|
function flush(): Promise<void> {
|
|
173
173
|
buffer.drain();
|
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
} from '@monochromatic-dev/module-logger';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
|
|
12
|
+
Sink factories under test, read from the built artifact's `sinks` namespace.
|
|
13
13
|
*/
|
|
14
14
|
const {
|
|
15
15
|
createLocalStorageSink,
|
|
16
16
|
} = sinks;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
Installs `fake` as `globalThis.localStorage` via the property descriptor,
|
|
20
|
+
restoring the original descriptor, or removing the property when none
|
|
21
|
+
existed, when the returned guard leaves `using` scope.
|
|
22
|
+
|
|
23
|
+
@param fake - Storage stand-in to install for the duration of the scope.
|
|
24
|
+
|
|
25
|
+
@returns Disposable that restores the original `localStorage` on exit.
|
|
26
26
|
*/
|
|
27
27
|
function installFakeLocalStorage(fake: Storage,): Disposable {
|
|
28
28
|
const original = Object.getOwnPropertyDescriptor(globalThis, 'localStorage',);
|
|
@@ -41,12 +41,12 @@ function installFakeLocalStorage(fake: Storage,): Disposable {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
Installs a minimal fake `globalThis.document` (absent under Node) so the
|
|
45
|
+
sink under test takes the DOM-host verify path instead of the flagless-Node
|
|
46
|
+
short-circuit, restoring or removing the global when the returned guard
|
|
47
|
+
leaves `using` scope.
|
|
48
|
+
|
|
49
|
+
@returns Disposable that restores the original `document` on exit.
|
|
50
50
|
*/
|
|
51
51
|
function installFakeDocument(): Disposable {
|
|
52
52
|
const had = 'document' in globalThis;
|
|
@@ -66,11 +66,11 @@ function installFakeDocument(): Disposable {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
Builds an in-memory `Storage` stand-in with enumeration support, exposing
|
|
70
|
+
the raw `backing` map so a test can assert exactly which keys and values
|
|
71
|
+
landed.
|
|
72
|
+
|
|
73
|
+
@returns Storage stand-in exposing the raw `backing` map.
|
|
74
74
|
*/
|
|
75
75
|
function createFakeStorage(): Storage & { readonly backing: Map<string, string>; } {
|
|
76
76
|
const backing = new Map<string, string>();
|
|
@@ -98,11 +98,11 @@ function createFakeStorage(): Storage & { readonly backing: Map<string, string>;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
Captures `console.warn` output, restoring the real method when the returned
|
|
102
|
+
guard leaves `using` scope, so a test can prove the flagless-Node
|
|
103
|
+
short-circuit stays silent.
|
|
104
|
+
|
|
105
|
+
@returns Disposable exposing captured warn lines as `calls`.
|
|
106
106
|
*/
|
|
107
107
|
function spyConsoleWarn(): Disposable & { readonly calls: string[]; } {
|
|
108
108
|
const original = console.warn;
|
|
@@ -163,7 +163,7 @@ await describe({
|
|
|
163
163
|
const sink = createLocalStorageSink();
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
|
-
|
|
166
|
+
Routine record that must stay buffered on its own.
|
|
167
167
|
*/
|
|
168
168
|
const first = {
|
|
169
169
|
level: 'info' as const,
|
|
@@ -171,7 +171,7 @@ await describe({
|
|
|
171
171
|
timestamp: 1,
|
|
172
172
|
};
|
|
173
173
|
/**
|
|
174
|
-
|
|
174
|
+
Urgent record whose severity flushes itself and `first` together.
|
|
175
175
|
*/
|
|
176
176
|
const second = {
|
|
177
177
|
level: 'warn' as const,
|
|
@@ -187,7 +187,7 @@ await describe({
|
|
|
187
187
|
expect([...fake.backing.values(),],)
|
|
188
188
|
.toEqual([`${JSON.stringify(first,)}\n${JSON.stringify(second,)}`,],);
|
|
189
189
|
/**
|
|
190
|
-
|
|
190
|
+
Identity of the landed key; the first batch of a run takes index zero.
|
|
191
191
|
*/
|
|
192
192
|
const { parsed: landed, } = parseLogKey([...fake.backing.keys(),][0] ?? '',);
|
|
193
193
|
expect(landed?.index,)
|
package/src/sink/noop.ts
CHANGED
|
@@ -4,19 +4,19 @@ import type {
|
|
|
4
4
|
} from '../types.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Noop verification: the sink is always available, so it never throws nor
|
|
8
|
+
needs setup.
|
|
9
|
+
|
|
10
|
+
@returns Always-resolved `true`.
|
|
11
11
|
*/
|
|
12
12
|
function verify(): Promise<boolean> {
|
|
13
13
|
return Promise.resolve(true,);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Discards a log record. Matches the `Sink['write']` signature.
|
|
18
|
+
|
|
19
|
+
@param _record - Log record to discard.
|
|
20
20
|
*/
|
|
21
21
|
function write(_record: LogRecord,): Promise<void> {
|
|
22
22
|
// Intentionally discards all logs; resolves immediately to match the async Sink contract.
|
|
@@ -24,19 +24,19 @@ function write(_record: LogRecord,): Promise<void> {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
Builds a noop sink that discards every record and always verifies as
|
|
28
|
+
available. Stateless, so the returned adapters share the same functions;
|
|
29
|
+
the factory shape merely matches the other sinks. Useful as a stand-in
|
|
30
|
+
that disables logging without removing log calls.
|
|
31
|
+
|
|
32
|
+
@returns Sink that discards all records and exposes no `flush` (nothing
|
|
33
|
+
is buffered).
|
|
34
|
+
|
|
35
|
+
@example
|
|
36
|
+
```ts
|
|
37
|
+
const { logger } = createLogger({ sinks: [createNoopSink()] });
|
|
38
|
+
logger.info('goes nowhere');
|
|
39
|
+
```
|
|
40
40
|
*/
|
|
41
41
|
export function createNoopSink(): Sink {
|
|
42
42
|
return {
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
|
|
8
8
|
declare global {
|
|
9
9
|
// oxlint-disable-next-line typescript/consistent-type-imports -- typeof import() cannot use import type syntax
|
|
10
|
-
var
|
|
10
|
+
var moduleLoggerBrowser: typeof import('@monochromatic-dev/module-logger/browser');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
test.describe('OPFS sink', () => {
|
|
14
14
|
test.beforeEach(async ({ page, },) => {
|
|
15
15
|
await page.goto('/',);
|
|
16
|
-
await page.waitForFunction(() => globalThis.
|
|
16
|
+
await page.waitForFunction(() => globalThis.moduleLoggerBrowser !== undefined);
|
|
17
17
|
},);
|
|
18
18
|
|
|
19
19
|
test('createOpfsSink exposes a callable verify', async ({ page, },) => {
|
|
20
20
|
const typeofVerify = await page.evaluate(() => {
|
|
21
|
-
const { createOpfsSink, } = globalThis.
|
|
21
|
+
const { createOpfsSink, } = globalThis.moduleLoggerBrowser;
|
|
22
22
|
return typeof createOpfsSink().verify;
|
|
23
23
|
},);
|
|
24
24
|
expect(typeofVerify,).toBe('function',);
|
|
@@ -26,7 +26,7 @@ test.describe('OPFS sink', () => {
|
|
|
26
26
|
|
|
27
27
|
test('verify resolves a boolean', async ({ page, },) => {
|
|
28
28
|
const resultType = await page.evaluate(async () => {
|
|
29
|
-
const { createOpfsSink, } = globalThis.
|
|
29
|
+
const { createOpfsSink, } = globalThis.moduleLoggerBrowser;
|
|
30
30
|
const resolved = await createOpfsSink().verify();
|
|
31
31
|
return typeof resolved;
|
|
32
32
|
},);
|
|
@@ -35,7 +35,7 @@ test.describe('OPFS sink', () => {
|
|
|
35
35
|
|
|
36
36
|
test('verify detects OPFS availability', async ({ page, },) => {
|
|
37
37
|
const result = await page.evaluate(async () => {
|
|
38
|
-
const { createOpfsSink, } = globalThis.
|
|
38
|
+
const { createOpfsSink, } = globalThis.moduleLoggerBrowser;
|
|
39
39
|
return createOpfsSink().verify();
|
|
40
40
|
},);
|
|
41
41
|
expect(result,).toBe(true,);
|
|
@@ -43,7 +43,7 @@ test.describe('OPFS sink', () => {
|
|
|
43
43
|
|
|
44
44
|
test('sink write method exists', async ({ page, },) => {
|
|
45
45
|
const typeofSink = await page.evaluate(() => {
|
|
46
|
-
const { createOpfsSink, } = globalThis.
|
|
46
|
+
const { createOpfsSink, } = globalThis.moduleLoggerBrowser;
|
|
47
47
|
return typeof createOpfsSink().write;
|
|
48
48
|
},);
|
|
49
49
|
expect(typeofSink,).toBe('function',);
|
|
@@ -51,7 +51,7 @@ test.describe('OPFS sink', () => {
|
|
|
51
51
|
|
|
52
52
|
test('a verified sink writes records across levels and message shapes', async ({ page, },) => {
|
|
53
53
|
const allSucceeded = await page.evaluate(async () => {
|
|
54
|
-
const { createOpfsSink, } = globalThis.
|
|
54
|
+
const { createOpfsSink, } = globalThis.moduleLoggerBrowser;
|
|
55
55
|
const sink = createOpfsSink();
|
|
56
56
|
await sink.verify();
|
|
57
57
|
const levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal',] as const;
|