Skip to content

Commit d8844f9

Browse files
Copilotleggetter
andcommitted
Fix build error: replace Warnf with structured logging in OnConnectionWarning
Co-authored-by: leggetter <[email protected]>
1 parent 7ad9104 commit d8844f9

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)