Use logger for helm output (#1585)

* use logger for helm output

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>

* update integration test output

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>

* make logging output configurable

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>

* also compare stderr in integration tests

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>

---------

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
This commit is contained in:
Tim Ramlot
2024-07-04 13:53:31 +09:00
committed by GitHub
parent f98d0673b8
commit 824e5a8b92
12 changed files with 61 additions and 22 deletions
+7 -1
View File
@@ -60,7 +60,13 @@ func NewRootCmd(globalConfig *config.GlobalOptions) (*cobra.Command, error) {
case globalConfig.Quiet:
logLevel = "warn"
}
logger = helmexec.NewLogger(os.Stderr, logLevel)
// If the log output is not set, default to stderr.
logOut := globalConfig.LogOutput
if logOut == nil {
logOut = os.Stderr
}
logger = helmexec.NewLogger(logOut, logLevel)
globalConfig.SetLogger(logger)
return nil
},