diff --git a/tgbot/misc/logging.py b/tgbot/misc/logging.py index 4e1c79d..ff3bdd8 100644 --- a/tgbot/misc/logging.py +++ b/tgbot/misc/logging.py @@ -2,6 +2,9 @@ from datetime import time, timedelta import sys +import aiogram_broadcaster +import gino +import sqlalchemy from loguru import logger @@ -25,9 +28,9 @@ def emit(self, record: logging.LogRecord) -> None: def setup(file_name: str = "log", rotation: time = time(), retention: timedelta = timedelta(days=3)) -> None: - # Disable aiogram_broadcaster logging - logging.getLogger("aiogram_broadcaster.text_broadcaster").setLevel(logging.FATAL) - logging.getLogger("aiogram_broadcaster.message_broadcaster").setLevel(logging.FATAL) + # Disable some packages logging + logging.getLogger(aiogram_broadcaster.__name__).setLevel(logging.FATAL) + logging.getLogger(gino.__name__).setLevel(logging.FATAL) # Setup loguru logger.remove()