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)