Generateurv2/backend/env/lib/python3.10/site-packages/aioredis/log.py

16 lines
423 B
Python
Raw Normal View History

2022-06-24 17:14:37 +02:00
import os
import sys
import logging
logger = logging.getLogger('aioredis')
sentinel_logger = logger.getChild('sentinel')
if os.environ.get("AIOREDIS_DEBUG"):
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(stream=sys.stderr)
handler.setFormatter(logging.Formatter(
"%(asctime)s %(name)s %(levelname)s %(message)s"))
logger.addHandler(handler)
os.environ["AIOREDIS_DEBUG"] = ""