1
0
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:
Francisco Souza
2016-02-03 12:30:39 -05:00
parent 538069c33f
commit d3ee281748
8 changed files with 30 additions and 34 deletions

View File

@ -3,7 +3,6 @@ package redis
import (
"errors"
"fmt"
"log"
)
var errDiscard = errors.New("redis: Discard can be used only inside Exec")
@ -53,7 +52,7 @@ func (c *Multi) putConn(cn *conn, err error) {
} else {
err := c.base.connPool.Put(cn)
if err != nil {
log.Printf("redis: putConn failed: %s", err)
Logger.Printf("redis: putConn failed: %s", err)
}
}
}
@ -70,7 +69,7 @@ func (c *Multi) process(cmd Cmder) {
func (c *Multi) Close() error {
c.closed = true
if err := c.Unwatch().Err(); err != nil {
log.Printf("redis: Unwatch failed: %s", err)
Logger.Printf("redis: Unwatch failed: %s", err)
}
return c.base.Close()
}