1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Log with context to associate all log by traceID (#1413)

* Log with context to associate all log by traceID
This commit is contained in:
刘青
2020-07-18 14:04:36 +08:00
committed by GitHub
parent f2645d373d
commit 8a3f304b25
8 changed files with 66 additions and 40 deletions

View File

@ -320,7 +320,7 @@ func (p *ConnPool) popIdle() *Conn {
func (p *ConnPool) Put(cn *Conn) {
if cn.rd.Buffered() > 0 {
internal.Logger.Printf("Conn has unread data")
internal.Logger.Printf(context.Background(), "Conn has unread data")
p.Remove(cn, BadConnError{})
return
}
@ -458,7 +458,7 @@ func (p *ConnPool) reaper(frequency time.Duration) {
}
_, err := p.ReapStaleConns()
if err != nil {
internal.Logger.Printf("ReapStaleConns failed: %s", err)
internal.Logger.Printf(context.Background(), "ReapStaleConns failed: %s", err)
continue
}
case <-p.closedCh: