From 3843ac2de2bdb5f89d20da0a0e29d67c2f0211f7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 21 Feb 2024 18:15:11 -0500 Subject: [PATCH] fix: do not print command directly and instead use LogWarn to send to stdout If we use the standard logging method from go-execute, any subprocess calls through plugn may capture the wrong output due to handling stdout. --- plugins/common/exec.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/common/exec.go b/plugins/common/exec.go index 2db72046d..84eaa8954 100644 --- a/plugins/common/exec.go +++ b/plugins/common/exec.go @@ -125,7 +125,11 @@ func CallExecCommandWithContext(ctx context.Context, input ExecCommandInput) (Ex } if os.Getenv("DOKKU_TRACE") == "1" { - cmd.PrintCommand = true + argsSt := "" + if len(cmd.Args) > 0 { + argsSt = strings.Join(cmd.Args, " ") + } + LogWarn(fmt.Sprintf("exec: %s %s", cmd.Command, argsSt)) } if input.Stdin != nil {