mirror of https://github.com/go-redis/redis.git
issue-1279 update logging
This commit is contained in:
parent
9a49a4d91d
commit
39272697aa
|
@ -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)
|
||||||
|
|
3
redis.go
3
redis.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue