Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vtctldclient] Set SilenceErrors on the root command, so we don't double-log #7404

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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