From 5d4e8af9f3d0c7df5f8e91bec76df213e6e3389a Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Mon, 7 Oct 2024 16:43:18 -0400 Subject: [PATCH] feat: log teapot output by line --- cmd/joj3/teapot/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/joj3/teapot/main.go b/cmd/joj3/teapot/main.go index 3db176e..56f9f71 100644 --- a/cmd/joj3/teapot/main.go +++ b/cmd/joj3/teapot/main.go @@ -34,7 +34,9 @@ func Run(conf conf.Conf) error { runNumber, conf.ScoreboardPath) // #nosec G204 outputBytes, err := cmd.CombinedOutput() output := re.ReplaceAllString(string(outputBytes), "") - slog.Info("joint-teapot joj3-scoreboard", "output", output) + for _, line := range strings.Split(output, "\n") { + slog.Info("joint-teapot joj3-scoreboard", "output", line) + } if err != nil { slog.Error("joint-teapot joj3-scoreboard", "err", err) return err @@ -44,7 +46,9 @@ func Run(conf conf.Conf) error { runNumber, conf.FailedTablePath) // #nosec G204 outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") - slog.Info("joint-teapot joj3-failed-table", "output", output) + for _, line := range strings.Split(output, "\n") { + slog.Info("joint-teapot joj3-scoreboard", "output", line) + } if err != nil { slog.Error("joint-teapot joj3-failed-table", "err", err) return err @@ -53,7 +57,9 @@ func Run(conf conf.Conf) error { envFilePath, conf.OutputPath, repoName, runNumber) // #nosec G204 outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") - slog.Info("joint-teapot joj3-create-result-issue", "output", output) + for _, line := range strings.Split(output, "\n") { + slog.Info("joint-teapot joj3-scoreboard", "output", line) + } if err != nil { slog.Error("joint-teapot joj3-create-result-issue", "err", err) return err