From 4eac5b06dc6ad8d960aecc207528c27d626d6040 Mon Sep 17 00:00:00 2001 From: Ida Hou Date: Thu, 19 Dec 2024 19:25:37 +0000 Subject: [PATCH] Added more logging to debug third party test. --- cmd/ops_agent_uap_wrapper/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/ops_agent_uap_wrapper/service.go b/cmd/ops_agent_uap_wrapper/service.go index eed1979bec..71588d09a6 100644 --- a/cmd/ops_agent_uap_wrapper/service.go +++ b/cmd/ops_agent_uap_wrapper/service.go @@ -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 }