Skip to content

Commit

Permalink
cli: use debug logger instead of cliLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Oct 24, 2024
1 parent 03fd049 commit a7b2a2c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cli/internal/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ func (f *applyFlags) parse(flags *pflag.FlagSet) error {

// runApply sets up the apply command and runs it.
func runApply(cmd *cobra.Command, _ []string) error {
log, err := newCLILogger(cmd)
if err != nil {
return fmt.Errorf("creating logger: %w", err)
}
spinner, err := newSpinnerOrStderr(cmd)
if err != nil {
return err
Expand Down Expand Up @@ -256,9 +252,9 @@ func runApply(cmd *cobra.Command, _ []string) error {
fileHandler: fileHandler,
flags: flags,
log: debugLogger,
wLog: &warnLogger{cmd: cmd, log: log},
wLog: &warnLogger{cmd: cmd, log: debugLogger},
spinner: spinner,
merger: &kubeconfigMerger{log: log},
merger: &kubeconfigMerger{log: debugLogger},
newInfraApplier: newInfraApplier,
imageFetcher: imagefetcher.New(),
applier: applier,
Expand Down Expand Up @@ -826,6 +822,7 @@ func (wl warnLogger) Info(msg string, args ...any) {
// Warn prints a formatted warning from the validator.
func (wl warnLogger) Warn(msg string, args ...any) {
wl.cmd.PrintErrf("Warning: %s %s\n", msg, fmt.Sprint(args...))
wl.log.Debug(msg, args...)
}

type warnLog interface {
Expand Down

0 comments on commit a7b2a2c

Please sign in to comment.