Commit b543069
authored
[log] Add debug logging to config_core.go (#4074)
Adds 5 meaningful debug logging calls to
`internal/config/config_core.go` using the existing `logConfig` logger
(`"config:config"`).
## Changes
**`applyGatewayDefaults`** — logs resolved defaults after all zero-value
fields are filled in:
```
Applied gateway defaults: port=3000, startupTimeout=30, toolTimeout=60, keepaliveInterval=1500
```
**`LoadFromFile`** — adds intermediate progress logs between the
existing entry/exit log calls:
1. Before unknown-field check: `Checking N undecoded TOML keys against
allowed fields`
2. Before stdio containerization validation: `Validating stdio server
containerization requirements for N servers`
3. Before auth validation loop: `Validating auth configuration for N
servers`
4. When `opentelemetry` section is present: `opentelemetry section
found: merging into tracing config, endpoint=...`
## Why
`LoadFromFile` already logs at entry and exit but its many intermediate
validation steps were invisible under debug logging. These additions
make it easy to pinpoint which validation step fails or how far
initialization progressed when troubleshooting startup issues with
`DEBUG=config:*`.
## Validation
- `go build ./...` — passes ✅
- `go vet ./...` — passes ✅
- `go test ./internal/...` — all packages pass; only
`TestFetchAndFixSchema_NetworkError` fails, which is a **pre-existing**
network-dependent test failure unrelated to these changes ✅
> [!WARNING]
> <details>
> <summary><strong>1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
373 | 383 | | |
374 | 384 | | |
375 | 385 | | |
376 | 386 | | |
377 | 387 | | |
378 | 388 | | |
379 | 389 | | |
| 390 | + | |
380 | 391 | | |
381 | 392 | | |
382 | 393 | | |
| |||
397 | 408 | | |
398 | 409 | | |
399 | 410 | | |
| 411 | + | |
400 | 412 | | |
401 | 413 | | |
402 | 414 | | |
| |||
0 commit comments