From a7a3b3a96e7520af02057ec9c0afbddaf82d0ad3 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 02 八月 2023 17:03:41 +0800 Subject: [PATCH] redis日志 --- db/redis_manager.py | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/db/redis_manager.py b/db/redis_manager.py index eb72e9b..a458769 100644 --- a/db/redis_manager.py +++ b/db/redis_manager.py @@ -4,6 +4,7 @@ import redis import constant +from log_module.log import logger_redis_debug config = constant.REDIS_CONFIG @@ -27,57 +28,69 @@ class RedisUtils: - @classmethod def get(cls, redis_, key): + logger_redis_debug.info("get:{}",key) return redis_.get(key) @classmethod def delete(cls, redis_, key): + logger_redis_debug.info("delete:{}", key) return redis_.delete(key) @classmethod def keys(cls, redis_, key): + logger_redis_debug.info("keys:{}", key) return redis_.keys(key) @classmethod def set(cls, redis_, key, val): + logger_redis_debug.info("set:{}", key) return redis_.set(key, val) @classmethod def setex(cls, redis_, key, expire, val): + logger_redis_debug.info("setex:{}", key) return redis_.setex(key, expire, val) @classmethod def expire(cls, redis_, key, expire): + logger_redis_debug.info("expire:{}", key) return redis_.expire(key, expire) @classmethod def sadd(cls, redis_, key, val): + logger_redis_debug.info("sadd:{}", key) return redis_.sadd(key, val) @classmethod def sismember(cls, redis_, key, val): + logger_redis_debug.info("sismember:{}", key) return redis_.sismember(key, val) @classmethod def smembers(cls, redis_, key): + logger_redis_debug.info("smembers:{}", key) return redis_.smembers(key) @classmethod def srem(cls, redis_, key, val): + logger_redis_debug.info("srem:{}", key) return redis_.srem(key, val) @classmethod def incrby(cls, redis_, key, num): + logger_redis_debug.info("incrby:{}", key) return redis_.incrby(key, num) @classmethod def lpush(cls, redis_, key, val): + logger_redis_debug.info("lpush:{}", key) return redis_.lpush(key, val) @classmethod def lpop(cls, redis_, key): + logger_redis_debug.info("lpop:{}", key) return redis_.lpop(key) -- Gitblit v1.8.0