Skip to content

Commit f28281c

Browse files
committed
chore: better playwright client logging
1 parent 586428a commit f28281c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/playwright-cloudflare/src/client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import { Connection } from 'playwright-core/lib/client/connection';
1818
import { nodePlatform } from 'playwright-core/lib/utils';
19-
import { debug } from 'playwright-core/lib/utilsBundle';
2019

2120
import type { Browser, BrowserWorker } from '..';
2221

@@ -39,7 +38,13 @@ export async function connect(endpoint: BrowserWorker, options: { sessionId: str
3938

4039
ws.accept();
4140

42-
const connection = new Connection(nodePlatform);
41+
const connection = new Connection({
42+
...nodePlatform,
43+
log(name: 'api' | 'channel', message: string | Error | object) {
44+
// eslint-disable-next-line no-console
45+
console.debug(name, message);
46+
},
47+
});
4348
connection.onmessage = message => ws.send(JSON.stringify(message));
4449
ws.addEventListener('message', message => {
4550
const data = message.data instanceof ArrayBuffer ? Buffer.from(message.data).toString() : message.data;

0 commit comments

Comments
 (0)