From a266dde0697605b97d0123cd4f439cf4463842a4 Mon Sep 17 00:00:00 2001 From: Joao Pereira Date: Tue, 24 Oct 2023 10:21:17 -0500 Subject: [PATCH] Use logger that always write on describe command Signed-off-by: Joao Pereira --- pkg/imgpkg/cmd/describe.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/imgpkg/cmd/describe.go b/pkg/imgpkg/cmd/describe.go index fb988c2d4..9bec515be 100644 --- a/pkg/imgpkg/cmd/describe.go +++ b/pkg/imgpkg/cmd/describe.go @@ -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{ @@ -78,11 +79,12 @@ func (d *DescribeOptions) Run() error { return err } + ttyEnabledLogger := util.NewUILevelLogger(logLevel, util.NewLoggerNoTTY(d.ui)) 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