diff --git a/client.go b/client.go index a117ee51..12486c90 100644 --- a/client.go +++ b/client.go @@ -86,14 +86,19 @@ func newClient(options *Options, clientGetter genericclioptions.RESTClientGetter return nil, err } + debugLog := options.DebugLog + if debugLog == nil { + debugLog = func(format string, v ...interface{}) { + log.Printf(format, v...) + } + } + actionConfig := new(action.Configuration) err = actionConfig.Init( clientGetter, settings.Namespace(), os.Getenv("HELM_DRIVER"), - func(format string, v ...interface{}) { - log.Printf(format, v) - }, + debugLog, ) if err != nil { return nil, err diff --git a/types.go b/types.go index b33359d4..9f990071 100644 --- a/types.go +++ b/types.go @@ -32,6 +32,7 @@ type Options struct { RepositoryCache string Debug bool Linting bool + DebugLog action.DebugLog } // RESTClientGetter defines the values of a helm REST client