Skip to content

Commit

Permalink
Add stderr of cvd executions to HO logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ser-io committed Oct 2, 2024
1 parent 457838a commit b4d306e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/host_orchestrator/orchestrator/cvd/cvd.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ func (e *CommandExecErr) Unwrap() error { return e.err }

func (c *Command) Run() error {
cmd := c.execContext(context.TODO(), cvdEnv(c.opts.AndroidHostOut), c.cvdBin, c.args...)
stderr := &bytes.Buffer{}
stderrBuff := &bytes.Buffer{}
stderrMw := io.MultiWriter(stderrBuff, log.Writer())
cmd.Stdout = c.opts.Stdout
cmd.Stderr = stderr
cmd.Stderr = stderrMw
if err := cmd.Start(); err != nil {
return err
}
if err := cmd.Wait(); err != nil {
LogStderr(cmd, stderr.String())
return &CommandExecErr{c.args, stderr.String(), err}
return &CommandExecErr{c.args, stderrBuff.String(), err}
}
return nil
}
Expand Down

0 comments on commit b4d306e

Please sign in to comment.