mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Declare and use a package-level Logger
This allow users of the API to override the Logger. Fix #250.
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"log"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -256,13 +255,13 @@ func (c *ClusterClient) reloadSlots() {
|
||||
|
||||
client, err := c.randomClient()
|
||||
if err != nil {
|
||||
log.Printf("redis: randomClient failed: %s", err)
|
||||
Logger.Printf("redis: randomClient failed: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
slots, err := client.ClusterSlots().Result()
|
||||
if err != nil {
|
||||
log.Printf("redis: ClusterSlots failed: %s", err)
|
||||
Logger.Printf("redis: ClusterSlots failed: %s", err)
|
||||
return
|
||||
}
|
||||
c.setSlots(slots)
|
||||
|
Reference in New Issue
Block a user