From 93ea294d170bfb1c7a74e117099c4b99b24f9ddf Mon Sep 17 00:00:00 2001 From: Andy Roth Date: Thu, 19 Dec 2024 16:52:04 -0800 Subject: [PATCH] Suggestion: Update SilenceErrors note If `SilenceErrors:` is false, Cobra will emit unstructured log lines. Since Zarf wants structured logs whenever possible it makes sense for this to be set to true. The value being true signifies that we will be emitting our own logs using `slog` when we are returning an error. --- src/cmd/root.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/root.go b/src/cmd/root.go index 153d31c1c9..88df9a71b8 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -124,8 +124,7 @@ func NewZarfCommand() *cobra.Command { Long: lang.RootCmdLong, Args: cobra.MaximumNArgs(1), SilenceUsage: true, - // TODO(mkcp): Do we actually want to silence errors here? - SilenceErrors: true, + SilenceErrors: true, // If false, Cobra will emit unstructured log lines. We don't want that. We'd rather emit our own slog lines when returning an error. PersistentPreRunE: preRun, Run: run, }