From 3840ba3c9834e7bab8901a676a716b3c8d441ddf Mon Sep 17 00:00:00 2001 From: Catherine Date: Sun, 7 Dec 2025 05:43:00 +0000 Subject: [PATCH] Use TOML output for `-print-config` instead of JSON. This is much easier to read, and can be used as a template for a new configuration. --- src/config.go | 4 ++-- src/main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.go b/src/config.go index acc1c66..841b054 100644 --- a/src/config.go +++ b/src/config.go @@ -166,8 +166,8 @@ type ObservabilityConfig struct { SlowResponseThreshold Duration `toml:"slow-response-threshold" default:"500ms"` } -func (config *Config) DebugJSON() string { - result, err := json.MarshalIndent(config, "", " ") +func (config *Config) TOML() string { + result, err := toml.Marshal(config) if err != nil { panic(err) } diff --git a/src/main.go b/src/main.go index 2ae5472..3692623 100644 --- a/src/main.go +++ b/src/main.go @@ -269,7 +269,7 @@ func Main() { } if *printConfig { - fmt.Println(config.DebugJSON()) + fmt.Println(config.TOML()) return }