Skip to content

Commit 02b141b

Browse files
authored
Merge pull request #165 from hookdeck/copilot/fix-build-error-logging
Fix format string mismatch in OnConnectionWarning logging
2 parents 98d5c40 + d8844f9 commit 02b141b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/listen/proxy/renderer_interactive.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,12 @@ func (r *InteractiveRenderer) OnEventError(eventID string, attempt *websocket.At
202202
// OnConnectionWarning is called when approaching connection limits
203203
func (r *InteractiveRenderer) OnConnectionWarning(activeRequests int32, maxConns int) {
204204
// In interactive mode, warnings could be shown in TUI
205-
// For now, just log it
206-
log.WithField("prefix", "proxy.InteractiveRenderer").
207-
Warnf("High connection load detected: %d active requests (limit: %d) --max-connections=%d to increase the limit", activeRequests, maxConns)
205+
// Use structured logging to avoid format-string mismatches and make logs machine-readable
206+
log.WithFields(log.Fields{
207+
"prefix": "proxy.InteractiveRenderer",
208+
"active_requests": activeRequests,
209+
"max_connections": maxConns,
210+
}).Warn("High connection load detected; consider increasing --max-connections")
208211
}
209212

210213
// Cleanup gracefully stops the TUI and restores terminal

0 commit comments

Comments
 (0)