mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 08:14:18 +02:00
enhanced config debug print (dump w/o ES structs)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user