mirror of
https://github.com/HeyPuter/gex.git
synced 2026-11-13 20:12:43 -10:00
browser-harness: console lines say when they came (@N s since the harness started)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_d2453757b8a84fdbb4ee7c9e093141df
This commit is contained in:
1 parent
ab5b821992
commit
91cc32d844
1 file changed
+3
-1
@@ -22,6 +22,8 @@ export const STATE = join(process.env.TMPDIR || '/tmp', `gex-nt-browser-${proces
|
||||
mkdirSync(STATE, { recursive: true });
|
||||
|
||||
export const log = (s) => process.stderr.write(`[nt-browser] ${s}\n`);
|
||||
/** When this harness started: console lines say how far in they came. */
|
||||
const T0 = Date.now();
|
||||
export const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
/**
|
||||
@@ -245,7 +247,7 @@ export async function openPage(query, { width = 1280, height = 900, shotDir = nu
|
||||
? !/^\[mesa-gl\] gex-gl: gl[A-Z]/.test(text)
|
||||
: p.type === 'warning' && /gex-nt|gex-wgpu|wine:|\[gex\]|panic|trap/i.test(text);
|
||||
if ((wanted || process.env.GEX_NT_BROWSER_VERBOSE) && printed++ < 20000) {
|
||||
log(`console[${sid?.slice(0, 6)}] ${text.slice(0, 4000)}`);
|
||||
log(`console[${sid?.slice(0, 6)} @${((Date.now() - T0) / 1000).toFixed(1)}s] ${text.slice(0, 4000)}`);
|
||||
}
|
||||
});
|
||||
browser.on('Runtime.exceptionThrown', (p, sid) => log(`exception[${sid?.slice(0, 6)}] ${p.exceptionDetails?.exception?.description ?? p.exceptionDetails?.text}`));
|
||||
|
||||
Reference in new issue
Block a user