Skip to content

Commit

Permalink
Set SilenceErrors on the root command, so we don't double-log
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mason <amason@slack-corp.com>
  • Loading branch information
ajm188 committed Jan 28, 2021
1 parent 4fea10e commit 2092f20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/cmd/vtctldclient/internal/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ var (
return err
},
TraverseChildren: true,
// By default, cobra will print any error returned by a child command to
// stderr, and then return that error back up the call chain. Since we
// use vitess's log package to log any error we get back from
// Root.Execute() (in ../../main.go) this actually results in duplicate
// stderr lines. So, somewhat counterintuitively, we actually "silence"
// all errors in cobra (just from being output, they still get
// propagated).
SilenceErrors: true,
}
)

Expand Down

0 comments on commit 2092f20

Please sign in to comment.