From 72b71e88292d2d9f8e75df24ff186c6689a765ef Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Mon, 7 Oct 2024 16:57:12 -0400 Subject: [PATCH] feat: log teapot output without empty line --- cmd/joj3/teapot/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/joj3/teapot/main.go b/cmd/joj3/teapot/main.go index 56f9f71..6068545 100644 --- a/cmd/joj3/teapot/main.go +++ b/cmd/joj3/teapot/main.go @@ -35,6 +35,9 @@ func Run(conf conf.Conf) error { outputBytes, err := cmd.CombinedOutput() output := re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") { + if line == "" { + continue + } slog.Info("joint-teapot joj3-scoreboard", "output", line) } if err != nil { @@ -47,6 +50,9 @@ func Run(conf conf.Conf) error { outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") { + if line == "" { + continue + } slog.Info("joint-teapot joj3-scoreboard", "output", line) } if err != nil { @@ -58,6 +64,9 @@ func Run(conf conf.Conf) error { outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") { + if line == "" { + continue + } slog.Info("joint-teapot joj3-scoreboard", "output", line) } if err != nil {