Skip to content

Commit

Permalink
Merge pull request #7404 from tinyspeck/am_vtctldclient_silence_errors
Browse files Browse the repository at this point in the history
[vtctldclient] Set `SilenceErrors` on the root command, so we don't double-log
  • Loading branch information
deepthi authored Feb 2, 2021
2 parents 9716598 + 2092f20 commit 0c99c57
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 0c99c57

Please sign in to comment.