From ce4d1cc83cc147395e3a6f8dfbf144a8bbeeaeda Mon Sep 17 00:00:00 2001 From: bjee19 <139261241+bjee19@users.noreply.github.com> Date: Mon, 13 Nov 2023 10:21:46 -0800 Subject: [PATCH] Remove usage info from log output (#1242) Remove usage info from log output. Problem: When a critical error occurs at startup, usage information for the binary is dumped into the log output. Solution: Set SilenceUsage and SilenceErrors to true in the root cobra.Command. --- cmd/gateway/commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/gateway/commands.go b/cmd/gateway/commands.go index 9e02599c65..f43cebbb40 100644 --- a/cmd/gateway/commands.go +++ b/cmd/gateway/commands.go @@ -30,7 +30,9 @@ const ( func createRootCommand() *cobra.Command { rootCmd := &cobra.Command{ - Use: "gateway", + Use: "gateway", + SilenceUsage: true, + SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() },