From d1d97fed1bf00e84d0bf5c781ce3e4af9b8c7708 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Mon, 11 May 2026 10:42:58 +0200 Subject: [PATCH] enhanced config debug print (dump w/o ES structs) --- pkg/cfg/config.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 }