Skip to content

Commit

Permalink
issue-1279 update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy Kudryk committed Mar 30, 2020
1 parent 9a49a4d commit 3927269
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion internal/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 1 addition & 2 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package redis
import (
"context"
"fmt"
"log"
"time"

"github.com/go-redis/redis/v7/internal"
Expand All @@ -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
}

Expand Down

0 comments on commit 3927269

Please sign in to comment.