Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#7404 from tinyspeck/am_vtctldclient_silen…
Browse files Browse the repository at this point in the history
…ce_errors

[vtctldclient] Set `SilenceErrors` on the root command, so we don't double-log
  • Loading branch information
deepthi authored and ajm188 committed Feb 11, 2021
1 parent 0082c4d commit d71cf9c
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 d71cf9c

Please sign in to comment.