import { Command } from '../command' ; import { Logger } from '../logger' ; import { FlowController } from './flow-controller' ; /**
 * Logs the stdout and stderr output of commands.
 */ export class LogOutput implements FlowController { private readonly logger : Logger ; constructor ( { logger } ) { this . logger = logger ; } handle ( commands ) { commands . forEach ( command => { command . stdout . subscribe ( text => this . logger . logCommandText ( text . toString ( ) , command ) ) ; command . stderr . subscribe ( text => this . logger . logCommandText ( text . toString ( ) , command ) ) ; } ) ; return { commands } ; } } ;