issue-1279 update logging

This commit is contained in:
Vitaliy Kudryk 2020-03-30 17:02:17 +03:00
parent 9a49a4d91d
commit 39272697aa
No known key found for this signature in database
GPG Key ID: 431A9AEE07F048B6
2 changed files with 6 additions and 3 deletions

View File

@ -5,4 +5,8 @@ import (
"os" "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)

View File

@ -3,7 +3,6 @@ package redis
import ( import (
"context" "context"
"fmt" "fmt"
"log"
"time" "time"
"github.com/go-redis/redis/v7/internal" "github.com/go-redis/redis/v7/internal"
@ -14,7 +13,7 @@ import (
// Nil reply returned by Redis when key does not exist. // Nil reply returned by Redis when key does not exist.
const Nil = proto.Nil const Nil = proto.Nil
func SetLogger(logger *log.Logger) { func SetLogger(logger internal.Logging) {
internal.Logger = logger internal.Logger = logger
} }