Set STDOUT to default out when printing via cobra

This commit is contained in:
Mike Farah 2020-09-13 11:49:55 +10:00
parent eedbb0a99f
commit 4eaadf98d0
1 changed files with 1 additions and 0 deletions

View File

@ -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}`,
)