diff --git a/src/cmd/root.go b/src/cmd/root.go index 68e14d37d5..04a3ec6ff0 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -154,6 +154,10 @@ func init() { rootCmd.PersistentFlags().MarkDeprecated("insecure", "please use --plain-http, --insecure-skip-tls-verify, or --skip-signature-validation instead.") rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.PlainHTTP, "plain-http", v.GetBool(common.VPlainHTTP), lang.RootCmdFlagPlainHTTP) rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.InsecureSkipTLSVerify, "insecure-skip-tls-verify", v.GetBool(common.VInsecureSkipTLSVerify), lang.RootCmdFlagInsecureSkipTLSVerify) + + // HACK(mkcp): This is a workaround for us testing that help output matches to the byte. Undo this and update tests + // before release. + rootCmd.PersistentFlags().MarkHidden("log-format") } // setup Logger handles creating a logger and setting it as the global default. @@ -162,16 +166,17 @@ func setupLogger(level, format string) (*slog.Logger, error) { if err != nil { return nil, err } - l, err := logger.New(logger.Config{ + cfg := logger.Config{ Level: sLevel, Format: logger.Format(format), Destination: logger.DestinationDefault, - }) + } + l, err := logger.New(cfg) if err != nil { return nil, err } logger.SetDefault(l) - l.Debug("Logger successfully initialized", "logger", l) + l.Debug("Logger successfully initialized", "cfg", cfg) return l, nil } diff --git a/src/config/lang/english.go b/src/config/lang/english.go index f755bfd984..5007ad9a1f 100644 --- a/src/config/lang/english.go +++ b/src/config/lang/english.go @@ -45,7 +45,7 @@ const ( RootCmdLong = "Zarf eliminates the complexity of air gap software delivery for Kubernetes clusters and cloud native workloads\n" + "using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments." - RootCmdFlagLogLevel = "Log level when running Zarf. Defaults to info. Valid options are: debug, info, warn, error" + RootCmdFlagLogLevel = "Log level when running Zarf. Valid options are: warn, info, debug, trace" RootCmdFlagLogFormat = "Select a logging format. Defaults to 'text'. Valid options are: 'text', 'json'" RootCmdFlagArch = "Architecture for OCI images and Zarf packages" RootCmdFlagSkipLogFile = "Disable log file creation"