Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

chore: adding config loggin on init

Luigi Agosti4663ddc671cd
diff --git a/internal/config/config.go b/internal/config/config.go
index a8f43ff3..29d662a1 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -437,25 +437,39 @@ func Load() *RuntimeConfig {
data, err := os.ReadFile(configPath)
if err != nil {
+ if !os.IsNotExist(err) {
+ slog.Warn("failed to read config file", "path", configPath, "error", err)
+ }
return cfg
}
+ slog.Debug("loading config file", "path", configPath)
+
var fc *FileConfig
if isLegacyConfig(data) {
var lc legacyFileConfig
if err := json.Unmarshal(data, &lc); err != nil {
+ slog.Warn("failed to parse legacy config", "path", configPath, "error", err)
return cfg
}
fc = convertLegacyConfig(&lc)
- slog.Debug("loaded legacy flat config, consider migrating to nested format")
+ slog.Info("loaded legacy flat config, consider migrating to nested format", "path", configPath)
} else {
fc = &FileConfig{}
if err := json.Unmarshal(data, fc); err != nil {
+ slog.Warn("failed to parse config", "path", configPath, "error", err)
return cfg
}
}
+ // Validate file config and log warnings
+ if errs := ValidateFileConfig(fc); len(errs) > 0 {
+ for _, e := range errs {
+ slog.Warn("config validation error", "path", configPath, "error", e)
+ }
+ }
+
// Apply file config (only if env var NOT set)
applyFileConfig(cfg, fc)