From e9233d8d17b43869f175103b038f9fa642518384 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sun, 5 Jun 2016 08:05:50 +0000 Subject: [PATCH] Cleanup loggers. --- internal/log.go | 13 +++---------- redis.go | 2 -- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/internal/log.go b/internal/log.go index c1cdbf4e..fd14222e 100644 --- a/internal/log.go +++ b/internal/log.go @@ -2,21 +2,14 @@ package internal import ( "fmt" - "io/ioutil" "log" ) -var Debug bool +var Logger *log.Logger -var Logger = log.New(ioutil.Discard, "redis: ", log.LstdFlags) - -func Debugf(s string, args ...interface{}) { - if !Debug { +func Logf(s string, args ...interface{}) { + if Logger == nil { return } Logger.Output(2, fmt.Sprintf(s, args...)) } - -func Logf(s string, args ...interface{}) { - Logger.Output(2, fmt.Sprintf(s, args...)) -} diff --git a/redis.go b/redis.go index e2c173b3..bb9fcd0a 100644 --- a/redis.go +++ b/redis.go @@ -8,8 +8,6 @@ import ( "gopkg.in/redis.v4/internal/pool" ) -var Logger *log.Logger - func SetLogger(logger *log.Logger) { internal.Logger = logger }