feat: add json log format option

Add log_format config field ("text" default, "json" for structured
JSON output) to support machine-readable logging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-14 16:45:38 +01:00
parent a40110f2f5
commit 3ebf88fb3e
3 changed files with 14 additions and 2 deletions

View File

@@ -11,7 +11,8 @@ import (
type Config struct {
SSH SSHConfig `toml:"ssh"`
Auth AuthConfig `toml:"auth"`
LogLevel string `toml:"log_level"`
LogLevel string `toml:"log_level"`
LogFormat string `toml:"log_format"` // "text" (default) or "json"
}
type SSHConfig struct {
@@ -73,6 +74,9 @@ func applyDefaults(cfg *Config) {
if cfg.LogLevel == "" {
cfg.LogLevel = "info"
}
if cfg.LogFormat == "" {
cfg.LogFormat = "text"
}
}
func validate(cfg *Config) error {