]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Include PeerConn prefix for log messages
authorMatt Joiner <anacrolix@gmail.com>
Tue, 16 May 2023 06:35:26 +0000 (16:35 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 16 May 2023 06:35:26 +0000 (16:35 +1000)
client.go

index 6a82774e7a0d5cf8f0fa4b265161de1076a40609..e641ffab74588b9c7d767f5648e2f0588bd5b14c 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1582,6 +1582,7 @@ func (cl *Client) newConnection(nc net.Conn, opts newConnectionOpts) (c *PeerCon
        }
        c.peerImpl = c
        c.logger = cl.logger.WithDefaultLevel(log.Warning)
+       c.logger = c.logger.WithContextText(fmt.Sprintf("%T %p", c, c))
        c.setRW(connStatsReadWriter{nc, c})
        c.r = &rateLimitedReader{
                l: cl.config.DownloadRateLimiter,