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

Suppress logging before flag.Parse from glog #2970

Merged
merged 4 commits into from
Feb 4, 2019
Merged
Changes from 3 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
6 changes: 5 additions & 1 deletion dgraph/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ cluster.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
initCmds()
goflag.Parse()

// Convinces goflags that Parse() has been called to avoid noisy logs.
// https://github.com/kubernetes/kubernetes/issues/17162#issuecomment-225596212
x.Check(goflag.CommandLine.Parse([]string{}))

if err := RootCmd.Execute(); err != nil {
jarifibrahim marked this conversation as resolved.
Show resolved Hide resolved
fmt.Println(err)
os.Exit(1)
Expand Down