ionelmc / python-redis-lock

Lock context manager implemented via redis SET NX EX and BLPOP.
https://pypi.python.org/pypi/python-redis-lock
BSD 2-Clause "Simplified" License
551 stars 77 forks source link

Lock acquisition is logged as INFO #112

Open nschagen opened 12 months ago

nschagen commented 12 months ago

Hello,

Small question: I noticed that the lock acquired log message is logged as info while the rest is logged as debug.

https://github.com/ionelmc/python-redis-lock/blob/master/src/redis_lock/__init__.py#L236

Is that intentional? I do see a lot of lock acquisitions in my log and would like to filter them out. What kind of way would you suggest to suppress them?

Thank you

ionelmc commented 11 months ago

Probably something like this in your logging config? Assuming you use some dict config style:

    "loggers": {
        "redis_lock.acquire": {
            "level": "WARNING",
        },
    }