File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 88 "github.com/jetstack/preflight/pkg/logs"
99 "github.com/spf13/cobra"
1010 "github.com/spf13/pflag"
11+
12+ "github.com/jetstack/preflight/pkg/logs"
1113)
1214
1315// rootCmd represents the base command when called without any subcommands
@@ -21,6 +23,14 @@ Preflight checks are bundled into Packages`,
2123 PersistentPreRun : func (cmd * cobra.Command , args []string ) {
2224 logs .Initialize ()
2325 },
26+ // SilenceErrors and SilenceUsage prevents this command or any sub-command
27+ // from printing arbitrary text to stderr.
28+ // Why? To ensure that each line of output can be parsed as a single message
29+ // for consumption by logging agents such as fluentd.
30+ // Usage information is still available on stdout with the `-h` and `--help`
31+ // flags.
32+ SilenceErrors : true ,
33+ SilenceUsage : true ,
2434}
2535
2636func init () {
You can’t perform that action at this time.
0 commit comments