2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-04-22 16:50:18 +08:00

add support for custom redis logger

This commit is contained in:
bp0 2021-01-29 18:28:52 -03:00
parent 2884044e75
commit 46912d19c5

View File

@ -11,6 +11,8 @@ import (
"strconv" "strconv"
"strings" "strings"
stdlog "log"
"github.com/go-redis/redis/v7" "github.com/go-redis/redis/v7"
) )
@ -206,6 +208,11 @@ func parseRedisSentinelURI(u *url.URL) (RedisConnOpt, error) {
return RedisFailoverClientOpt{MasterName: master, SentinelAddrs: addrs, Password: password}, nil return RedisFailoverClientOpt{MasterName: master, SentinelAddrs: addrs, Password: password}, nil
} }
//SetReditLogger set redit logger
func SetReditLogger(logger *stdlog.Logger) {
redis.SetLogger(logger)
}
// createRedisClient returns a redis client given a redis connection configuration. // createRedisClient returns a redis client given a redis connection configuration.
// //
// Passing an unexpected type as a RedisConnOpt argument will cause panic. // Passing an unexpected type as a RedisConnOpt argument will cause panic.