mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 23:56:37 +08:00
feat: 重构日志处理,使用slog包替换原有日志函数,增强日志记录能力
This commit is contained in:
@@ -3,6 +3,7 @@ package common
|
||||
import (
|
||||
"context"
|
||||
"github.com/go-redis/redis/v8"
|
||||
"log/slog"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
@@ -14,7 +15,7 @@ var RedisEnabled = true
|
||||
func InitRedisClient() (err error) {
|
||||
if os.Getenv("REDIS_CONN_STRING") == "" {
|
||||
RedisEnabled = false
|
||||
SysLog("REDIS_CONN_STRING not set, Redis is not enabled")
|
||||
slog.Info("redis disabled because REDIS_CONN_STRING is not set")
|
||||
return nil
|
||||
}
|
||||
opt, err := redis.ParseURL(os.Getenv("REDIS_CONN_STRING"))
|
||||
|
||||
Reference in New Issue
Block a user