Repository navigation
[log] Add debug logging to guard registry - #16363
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported, and the change is limited to adding debug observability around existing guard-registry operations.
No open issues 🎉
What changed in this PR
Adds debug-level observability to the guard registry while preserving existing guard behavior and registry semantics.
Changes:
- Logs guard lookup and source-guard detection decisions, including skipped write-sink guards.
- Logs guard shutdown counts and individual closures.
- Logs dynamic guard-type registrations.
| File | Description |
|---|---|
| internal/guard/registry.go | Adds debug logging to guard lookups, source-guard detection, shutdown, and guard-type registration. |
Review effort: Lite (auto)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE (
|
Adds 6 debug log calls to
internal/guard/registry.gousing the existinglogRegistrylogger:Has,HasNonNoopSourceGuard(write-sink skip, source guard found, none found),Close(count and per-guard), andRegisterGuardType. No side effects in log arguments.Validation:
go vetandgo test ./internal/guardpass;go buildsucceeds.Note: all files lacking loggers were either already processed or in packages that would cause import cycles with
internal/logger, so this file with sparse coverage was chosen.