Skip to content

Commit ce4d1cc

Browse files
authored
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.
1 parent 9e7ff57 commit ce4d1cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/gateway/commands.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const (
3030

3131
func createRootCommand() *cobra.Command {
3232
rootCmd := &cobra.Command{
33-
Use: "gateway",
33+
Use: "gateway",
34+
SilenceUsage: true,
35+
SilenceErrors: true,
3436
RunE: func(cmd *cobra.Command, args []string) error {
3537
return cmd.Help()
3638
},

0 commit comments

Comments
 (0)