1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Move logging to internal package.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 13:54:44 +03:00
parent 4fba0dda91
commit 8679174a1b
9 changed files with 59 additions and 34 deletions

View File

@ -6,6 +6,7 @@ import (
"sync/atomic"
"time"
"gopkg.in/redis.v3/internal"
"gopkg.in/redis.v3/internal/hashtag"
"gopkg.in/redis.v3/internal/pool"
)
@ -269,13 +270,13 @@ func (c *ClusterClient) reloadSlots() {
client, err := c.randomClient()
if err != nil {
Logger.Printf("randomClient failed: %s", err)
internal.Logf("randomClient failed: %s", err)
return
}
slots, err := client.ClusterSlots().Result()
if err != nil {
Logger.Printf("ClusterSlots failed: %s", err)
internal.Logf("ClusterSlots failed: %s", err)
return
}
c.setSlots(slots)
@ -302,14 +303,14 @@ func (c *ClusterClient) reaper(frequency time.Duration) {
for _, client := range c.getClients() {
nn, err := client.connPool.(*pool.ConnPool).ReapStaleConns()
if err != nil {
Logger.Printf("ReapStaleConns failed: %s", err)
internal.Logf("ReapStaleConns failed: %s", err)
} else {
n += nn
}
}
s := c.PoolStats()
Logger.Printf(
internal.Logf(
"reaper: removed %d stale conns (TotalConns=%d FreeConns=%d Requests=%d Hits=%d Timeouts=%d)",
n, s.TotalConns, s.FreeConns, s.Requests, s.Hits, s.Timeouts,
)