Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 28, 2022
1 parent 262dd6a commit 8a9c768
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict';

import * as childProcess from 'child_process';
import * as readline from 'readline';
import * as fs from 'fs';
import * as net from 'net';
import * as chromeFinder from './chrome-finder';
Expand Down Expand Up @@ -295,7 +296,18 @@ class Launcher {
'ChromeLauncher', `Launching with command:\n"${execPath}" ${this.flags.join(' ')}`);
const chrome = this.spawn(
execPath, this.flags,
{detached: true, stdio: ['ignore', this.outFile, this.errFile], env: this.envVars});
{detached: true, stdio: ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'], env: this.envVars});


const stdout = readline.createInterface({ input: chrome.stdout! });
stdout.on('line', (data: string) => {
console.log(`CL[pid=${chrome.pid}][out] ` + data);
});

const stderr = readline.createInterface({ input: chrome.stderr! });
stderr.on('line', (data: string) => {
console.log(`CL[pid=${chrome.pid}][err] ` + data);
});
this.chrome = chrome;


Expand Down

0 comments on commit 8a9c768

Please sign in to comment.