diff --git a/internal/log.go b/internal/log.go index 405a272..49cef75 100644 --- a/internal/log.go +++ b/internal/log.go @@ -5,4 +5,8 @@ import ( "os" ) -var Logger = log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile) +type Logging interface { + Printf(format string, v ...interface{}) +} + +var Logger Logging = log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile) diff --git a/redis.go b/redis.go index 3d9dfed..bc8fe8b 100644 --- a/redis.go +++ b/redis.go @@ -3,7 +3,6 @@ package redis import ( "context" "fmt" - "log" "time" "github.com/go-redis/redis/v7/internal" @@ -14,7 +13,7 @@ import ( // Nil reply returned by Redis when key does not exist. const Nil = proto.Nil -func SetLogger(logger *log.Logger) { +func SetLogger(logger internal.Logging) { internal.Logger = logger }