Split shared config validation logger into per-file loggers - #12252
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
All shared logger references were consistently replaced with correctly scoped per-file loggers.
Pull request overview
Splits config validation logging into per-file loggers so DEBUG namespaces identify the actual source file.
Changes:
- Adds dedicated
logger.ForFile()instances across seven config files. - Updates all 66 references and removes the obsolete shared logger file.
File summaries
| File | Description |
|---|---|
internal/config/agent_policy.go |
Adds the agent-policy logger. |
internal/config/expand.go |
Adds the expansion logger. |
internal/config/validation_errors.go |
Adds the validation-error logger. |
internal/config/validation_gateway.go |
Adds the gateway-validation logger. |
internal/config/validation_rules.go |
Adds the rule-validation logger. |
internal/config/validation_server.go |
Adds the server-validation logger. |
internal/config/validation_shared.go |
Removes the shared logger declaration. |
internal/config/validation_tracing.go |
Adds the tracing-validation logger. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes succeeded. Zero FAILs. References: §33449217297
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No FAIL conditions triggered. References: §33449217230
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write leaked. Gateway DIFC/guard enforcement was not independently exercised on this run due to structural limitations (backend never registers write tools; gh CLI unauthenticated). Independent confirmation of gateway write-blocking is covered by References: §33449217272
|
internal/config/validation_shared.goexisted only to declare a single package-levellogValidationlogger, reused across 7 other files (66 call sites). Sincelogger.ForFile()derives its debug namespace from where the variable is declared, all 66 call sites logged underconfig:validation_sharedregardless of the actual emitting file — makingDEBUG=config:*filtering misleading.Changes
internal/config/validation_shared.go.logger.ForFile()logger directly in each file that previously used the shared one, so its namespace reflects the correct source file:agent_policy.go→logAgentPolicyexpand.go→logExpandvalidation_errors.go→logValidationErrorsvalidation_gateway.go→logValidationGatewayvalidation_rules.go→logValidationRulesvalidation_server.go→logValidationServervalidation_tracing.go→logValidationTracingNo behavioral change — this only restores per-file
DEBUGnamespace accuracy for config validation logging.