diff --git a/pkg/cfg/config.go b/pkg/cfg/config.go index 3fb3899..ed518f0 100644 --- a/pkg/cfg/config.go +++ b/pkg/cfg/config.go @@ -24,6 +24,7 @@ import ( "net/http" "os" + "github.com/alecthomas/repr" "github.com/elastic/elastic-transport-go/v8/elastictransport" "github.com/elastic/go-elasticsearch/v9" "gopkg.in/yaml.v3" @@ -108,6 +109,26 @@ func (conf *Config) Init() error { } } + conf.PrintDebug() + + return nil +} + +func (conf *Config) PrintDebug() error { + if !conf.Debug { + return nil + } + + clone := *conf + + for name := range clone.Clusters { + clone.Clusters[name] = nil + } + clone.DefaultCluster = nil + + fmt.Println("config:") + repr.Println(clone) + return nil }