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:
5
redis.go
5
redis.go
@ -4,9 +4,12 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Logger = log.New(os.Stderr, "", log.LstdFlags)
|
||||
|
||||
type baseClient struct {
|
||||
connPool pool
|
||||
opt *Options
|
||||
@ -27,7 +30,7 @@ func (c *baseClient) putConn(cn *conn, err error) {
|
||||
err = c.connPool.Put(cn)
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("redis: putConn failed: %s", err)
|
||||
Logger.Printf("redis: putConn failed: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user