From cb3f46b46e1f3c83bbd48165f254888de095bd05 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 9 Jan 2025 12:08:42 +0100 Subject: [PATCH] fix: redirect to stderr for machine output See https://git.coopcloud.tech/toolshed/abra/issues/477 --- cli/run.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/run.go b/cli/run.go index c7d97ea2..104b3bf2 100644 --- a/cli/run.go +++ b/cli/run.go @@ -51,6 +51,10 @@ func Run(version, commit string) { log.Logger.SetStyles(charmLog.DefaultStyles()) charmLog.SetDefault(log.Logger) + if internal.MachineReadable { + log.SetOutput(os.Stderr) + } + if internal.Debug { log.SetLevel(log.DebugLevel) log.SetOutput(os.Stderr)