Cleanup loggers.

This commit is contained in:
Vladimir Mihailenco 2016-06-05 08:05:50 +00:00
parent c0622ff8dc
commit e9233d8d17
2 changed files with 3 additions and 12 deletions

View File

@ -2,21 +2,14 @@ package internal
import ( import (
"fmt" "fmt"
"io/ioutil"
"log" "log"
) )
var Debug bool var Logger *log.Logger
var Logger = log.New(ioutil.Discard, "redis: ", log.LstdFlags) func Logf(s string, args ...interface{}) {
if Logger == nil {
func Debugf(s string, args ...interface{}) {
if !Debug {
return return
} }
Logger.Output(2, fmt.Sprintf(s, args...)) Logger.Output(2, fmt.Sprintf(s, args...))
} }
func Logf(s string, args ...interface{}) {
Logger.Output(2, fmt.Sprintf(s, args...))
}

View File

@ -8,8 +8,6 @@ import (
"gopkg.in/redis.v4/internal/pool" "gopkg.in/redis.v4/internal/pool"
) )
var Logger *log.Logger
func SetLogger(logger *log.Logger) { func SetLogger(logger *log.Logger) {
internal.Logger = logger internal.Logger = logger
} }