From 0964dccbf117ff23252ef975c279169c6af8a7a5 Mon Sep 17 00:00:00 2001 From: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com> Date: Sat, 25 Oct 2025 21:49:01 +0300 Subject: [PATCH] Update internal/pool/pool.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- internal/pool/pool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/pool/pool.go b/internal/pool/pool.go index 59b8e194..876f2691 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -693,7 +693,9 @@ func (p *ConnPool) putConn(ctx context.Context, cn *Conn, freeTurn bool) { if err != nil { // Hook changed the state (e.g., to UNUSABLE for handoff) // Keep the state set by the hook and pool the connection anyway - internal.Logger.Printf(ctx, "Connection state changed by hook to %v, pooling as-is", currentState) + if internal.Logger.Enabled(ctx, internal.LogLevelDebug) { + internal.Logger.Printf(ctx, "Connection state changed by hook to %v, pooling as-is", currentState) + } } // unusable conns are expected to become usable at some point (background process is reconnecting them)