Skip to content

Commit

Permalink
Added more logging to debug third party test.
Browse files Browse the repository at this point in the history
  • Loading branch information
XuechunHou committed Dec 19, 2024
1 parent 987e437 commit 4eac5b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/ops_agent_uap_wrapper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,13 @@ func runCommand(cmd *exec.Cmd, logger logs.StructuredLogger) (string, error) {
journal.Print(journal.PriInfo, "%s", msg)
if err := cmd.Run(); err != nil {
fullError := fmt.Errorf("failed to execute cmd: %s with arguments %s, \ncommand output: %s\n error: %s %s", cmd.Path, cmd.Args, outb.String(), errb.String(), err)
logger.Errorf(fullError.Error())
journal.Print(journal.PriErr, "%s", fullError)
return fmt.Sprintf("%s %s", outb.String(), errb.String()), fullError
}
msg = fmt.Sprintf("output: %s, err: %s", outb.String(), errb.String())
logger.Infof(msg)
journal.Print(journal.PriInfo, "%s", msg)
return fmt.Sprintf("%s %s", outb.String(), errb.String()), nil
}

Expand Down

0 comments on commit 4eac5b0

Please sign in to comment.