mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +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:
4
ring.go
4
ring.go
@ -304,7 +304,7 @@ func (c *ringShards) Heartbeat(frequency time.Duration) {
|
||||
err := shard.Client.Ping(ctx).Err()
|
||||
isUp := err == nil || err == pool.ErrPoolTimeout
|
||||
if shard.Vote(isUp) {
|
||||
internal.Logger.Printf("ring shard state changed: %s", shard)
|
||||
internal.Logger.Printf(context.Background(), "ring shard state changed: %s", shard)
|
||||
rebalance = true
|
||||
}
|
||||
}
|
||||
@ -558,7 +558,7 @@ func (c *Ring) cmdInfo(name string) *CommandInfo {
|
||||
}
|
||||
info := cmdsInfo[name]
|
||||
if info == nil {
|
||||
internal.Logger.Printf("info for cmd=%s not found", name)
|
||||
internal.Logger.Printf(c.Context(), "info for cmd=%s not found", name)
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
Reference in New Issue
Block a user