From b4d306e8e5e28e1c031e73595782547e20d165d9 Mon Sep 17 00:00:00 2001 From: Sergio Andres Rodriguez Orama Date: Tue, 1 Oct 2024 14:56:09 -0400 Subject: [PATCH] Add stderr of cvd executions to HO logs. --- frontend/src/host_orchestrator/orchestrator/cvd/cvd.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/host_orchestrator/orchestrator/cvd/cvd.go b/frontend/src/host_orchestrator/orchestrator/cvd/cvd.go index b14ade9334..294065fbf8 100644 --- a/frontend/src/host_orchestrator/orchestrator/cvd/cvd.go +++ b/frontend/src/host_orchestrator/orchestrator/cvd/cvd.go @@ -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 }