From 4eaadf98d045b9f38990835b7b89955b7bfc3987 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sun, 13 Sep 2020 11:49:55 +1000 Subject: [PATCH] Set STDOUT to default out when printing via cobra --- cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/root.go b/cmd/root.go index d590a387..a7f9b6bd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -22,6 +22,7 @@ func New() *cobra.Command { return nil }, PersistentPreRun: func(cmd *cobra.Command, args []string) { + cmd.SetOut(cmd.OutOrStdout()) var format = logging.MustStringFormatter( `%{color}%{time:15:04:05} %{shortfunc} [%{level:.4s}]%{color:reset} %{message}`, )