Skip to content

Commit

Permalink
Suggestion: Update SilenceErrors note
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Andy Roth <roth.andy@gmail.com>
  • Loading branch information
RothAndrew committed Dec 20, 2024
1 parent 411b758 commit e239202
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit e239202

Please sign in to comment.