Skip to content

Commit 8a9c768

Browse files
committed
more logging
1 parent 262dd6a commit 8a9c768

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/chrome-launcher.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'use strict';
77

88
import * as childProcess from 'child_process';
9+
import * as readline from 'readline';
910
import * as fs from 'fs';
1011
import * as net from 'net';
1112
import * as chromeFinder from './chrome-finder';
@@ -295,7 +296,18 @@ class Launcher {
295296
'ChromeLauncher', `Launching with command:\n"${execPath}" ${this.flags.join(' ')}`);
296297
const chrome = this.spawn(
297298
execPath, this.flags,
298-
{detached: true, stdio: ['ignore', this.outFile, this.errFile], env: this.envVars});
299+
{detached: true, stdio: ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'], env: this.envVars});
300+
301+
302+
const stdout = readline.createInterface({ input: chrome.stdout! });
303+
stdout.on('line', (data: string) => {
304+
console.log(`CL[pid=${chrome.pid}][out] ` + data);
305+
});
306+
307+
const stderr = readline.createInterface({ input: chrome.stderr! });
308+
stderr.on('line', (data: string) => {
309+
console.log(`CL[pid=${chrome.pid}][err] ` + data);
310+
});
299311
this.chrome = chrome;
300312

301313

0 commit comments

Comments
 (0)