Skip to content

Commit

Permalink
chore: Simplify emulator output handling (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jul 3, 2024
1 parent b31637d commit d1336e8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/tools/system-calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,9 @@ systemCallMethods.launchAVD = async function launchAVD (avdName, opts = {}) {
env: Object.assign({}, process.env, env),
});
await proc.start(0);
proc.on('output', (stdout, stderr) => {
for (let line of (stdout || stderr || '').split('\n').filter(Boolean)) {
log.info(`[AVD OUTPUT] ${line}`);
}
});
for (const streamName of ['stderr', 'stdout']) {
proc.on(`line-${streamName}`, (line) => log.debug(`[AVD OUTPUT] ${line}`));
}
proc.on('die', (code, signal) => {
log.warn(`Emulator avd ${avdName} exited with code ${code}${signal ? `, signal ${signal}` : ''}`);
});
Expand Down

0 comments on commit d1336e8

Please sign in to comment.