Skip to content

Commit

Permalink
Use logger that always write on describe command
Browse files Browse the repository at this point in the history
Signed-off-by: Joao Pereira <[email protected]>
  • Loading branch information
joaopapereira committed Oct 24, 2023
1 parent 6e1758a commit a266dde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/imgpkg/cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (d *DescribeOptions) Run() error {
logLevel := util.LogWarn

levelLogger := util.NewUILevelLogger(logLevel, util.NewLogger(d.ui))
ttyEnabledLogger := util.NewUILevelLogger(logLevel, util.NewLoggerNoTTY(d.ui))
description, err := v1.Describe(
d.BundleFlags.Bundle,
v1.DescribeOpts{
Expand All @@ -78,11 +79,12 @@ func (d *DescribeOptions) Run() error {
return err
}

ttyEnabledLogger := util.NewUILevelLogger(logLevel, util.NewLoggerNoTTY(d.ui))

Check failure on line 82 in pkg/imgpkg/cmd/describe.go

View workflow job for this annotation

GitHub Actions / lint

no new variables on left side of :=) (typecheck)
if d.OutputType == "text" {
p := bundleTextPrinter{logger: levelLogger}
p := bundleTextPrinter{logger: ttyEnabledLogger}
p.Print(description)
} else if d.OutputType == "yaml" {
p := bundleYAMLPrinter{logger: util.NewUILevelLogger(logLevel, util.NewLoggerNoTTY(d.ui))}
p := bundleYAMLPrinter{logger: ttyEnabledLogger}
return p.Print(description)
}
return nil
Expand Down

0 comments on commit a266dde

Please sign in to comment.