CoolFace
Apppublic

ANDHEKA/Stringtest

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
logger.py24 linesDownload Raw Back to root
1import logging2 3logging.basicConfig(format='[%(asctime)s - %(levelname)s] - %(name)s : %(message)s',4                    datefmt='%Y-%m-%d %H:%M:%S',5                    level=logging.INFO)6 7 8class AsyncioFilter(logging.Filter):9    def filter(self, record):10        if record.levelname == 'ERROR' and "Task was destroyed but it is pending!" in record.msg:11            return False12        return True13 14 15asyncio_logger = logging.getLogger('asyncio')16asyncio_logger.addFilter(AsyncioFilter())17 18logging.getLogger('telethon').setLevel(logging.WARNING)19logging.captureWarnings(True)20 21 22def LOGGER(name: str) -> logging.Logger:23    return logging.getLogger(name)24