Skip to content

Conversation

@github-actions
Copy link
Contributor

Summary

Added debug logging to internal/server/handlers.go to improve troubleshooting and development visibility.

Changes

Logger Declaration

  • Added logHandlers debug logger with namespace server:handlers following the project's pkg:filename convention

Logging Enhancements (7 new statements)

  1. OAuth Discovery Handler

    • Log handler creation
    • Log incoming OAuth discovery requests with remote address, method, and path
  2. Close Endpoint Handler

    • Log handler creation
    • Log incoming close requests with remote address, method, and path
    • Log method validation failures
    • Log shutdown state checks (already closed scenario)
    • Log shutdown initiation
    • Log shutdown completion with server count

Benefits

  • Troubleshooting: Debug logs provide context for request handling and shutdown sequences
  • Zero Overhead: Logs only computed when DEBUG=server:handlers is set
  • Dual Output: Logs written to both stderr (colored, with time diffs) and file logger (text-only)
  • No Side Effects: All logger arguments are simple values, no function calls or computations

Testing

The changes follow the established logging patterns in the codebase and maintain consistency with other handlers.

Compliance

✅ Exactly 1 file modified (focused, single-file PR)
✅ No test files modified
✅ Logger naming follows pkg:filename convention
✅ Logger arguments have no side effects
✅ Logging messages are meaningful and helpful
✅ No duplicate logging with existing logs
✅ Follows AGENTS.md guidelines

AI generated by Go Logger Enhancement

- Add logHandlers debug logger with namespace server:handlers
- Add logging for OAuth discovery handler lifecycle
- Add logging for close endpoint handler lifecycle
- Add logging for shutdown validation and execution
- 7 new debug log statements for troubleshooting

Follows project logging conventions from AGENTS.md
@github-actions github-actions bot added automation enhancement New feature or request labels Jan 21, 2026
@lpcox lpcox marked this pull request as ready for review January 21, 2026 16:18
@lpcox lpcox merged commit 7cdee64 into main Jan 21, 2026
@lpcox lpcox deleted the main-a97df815b28faf21 branch January 21, 2026 16:18
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.

1 participant