Skip to content

Conversation

@github-actions
Copy link
Contributor

Summary

Enhanced internal/guard/registry.go with debug logging for better troubleshooting and development visibility.

Changes Made

  • Added debug logger with namespace guard:registry following project conventions
  • Added logging to key functions:
    • NewRegistry() - Logs registry creation
    • Register() - Logs guard registration with server ID and guard name
    • Get() - Logs guard retrieval attempts and results
    • Remove() - Logs guard removal operations
    • CreateGuard() - Logs guard factory operations with type resolution

Debug Logging Features

All debug logs:

  • Write to stderr with colors and time diffs when DEBUG=guard:* or DEBUG=*
  • Write to file logger (text-only) for persistent troubleshooting
  • Use meaningful parameter values (serverID, guardName) without side effects
  • Follow the pkg:filename naming convention

Testing

Enable debug logging with:

DEBUG=guard:* ./awmg --config config.toml

Compliance

✅ Single file modified (focused PR)
✅ No test files modified
✅ Logger naming follows pkg:filename convention
✅ No side effects in log arguments
✅ Meaningful log messages for debugging
✅ No duplicate logging with existing logs
✅ Proper import formatting

AI generated by Go Logger Enhancement

- Added debug logger with namespace guard:registry
- Added logging to NewRegistry, Register, Get, Remove, and CreateGuard functions
- Follows project logging conventions with meaningful messages
- No side effects in log arguments
@github-actions github-actions bot added automation enhancement New feature or request labels Jan 18, 2026
@lpcox lpcox marked this pull request as ready for review January 18, 2026 15:50
@lpcox lpcox merged commit 940524b into main Jan 18, 2026
@lpcox lpcox deleted the main-cf279aa072232e6b branch January 18, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants