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

Add PoolStats.StaleConns and enable logging by default

This commit is contained in:
Vladimir Mihailenco
2017-09-11 09:10:17 +03:00
parent 1173a9589f
commit 5294b5dae1
6 changed files with 26 additions and 29 deletions

View File

@ -3,6 +3,7 @@ package redis
import (
"fmt"
"log"
"os"
"time"
"github.com/go-redis/redis/internal"
@ -13,6 +14,10 @@ import (
// Redis nil reply, .e.g. when key does not exist.
const Nil = internal.Nil
func init() {
SetLogger(log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile))
}
func SetLogger(logger *log.Logger) {
internal.Logger = logger
}