Skip to content

[log] Add debug logging to BaseResponseWriter#8616

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
log/httputil-response-writer-43f7c0acfa074956
Draft

[log] Add debug logging to BaseResponseWriter#8616
github-actions[bot] wants to merge 1 commit into
mainfrom
log/httputil-response-writer-43f7c0acfa074956

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds meaningful debug logging calls to internal/httputil/response_writer.go using the existing logHTTP logger (declared in httputil.go).

Changes

File: internal/httputil/response_writer.go

Added 3 logHTTP.Printf calls to BaseResponseWriter:

  1. WriteHeader — first call: logs the status code being captured
  2. WriteHeader — duplicate call: logs when a subsequent WriteHeader is ignored, showing both the new and already-captured codes
  3. Write — implicit 200: logs when Write triggers an implicit 200 OK capture, including payload length

These log calls help trace HTTP response status flows during debugging, especially when investigating unexpected status codes or duplicate header writes.

Notes

  • No new logger declaration needed — reuses the package-level logHTTP from httputil.go
  • No test files modified
  • Logger arguments have no side effects
  • go test ./internal/httputil/... and go vet ./internal/httputil/... pass
  • go build succeeds

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go Logger Enhancement · 480.4 AIC · ⊞ 7.6K ·

…iter.go

Add logHTTP debug calls to WriteHeader and Write methods of BaseResponseWriter
to trace HTTP status code capture behaviour:
- Log when a status code is first captured by WriteHeader
- Log when a duplicate WriteHeader call is ignored (with already-captured code)
- Log when Write implicitly captures a 200 status on first write

Uses the existing logHTTP logger declared in httputil.go (no new declaration needed).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Jul 3, 2026
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.

0 participants