diff --git a/misskaty/plugins/fun.py b/misskaty/plugins/fun.py index aceab91a..740b1d26 100644 --- a/misskaty/plugins/fun.py +++ b/misskaty/plugins/fun.py @@ -1,4 +1,4 @@ -import textwrap +import textwrap, logging from asyncio import gather from os import remove as hapus @@ -11,6 +11,7 @@ from misskaty.core.decorator.ratelimiter import ratelimiter from misskaty.helper.localization import use_chat_lang from misskaty.vars import COMMAND_HANDLER +LOGGER = logging.getLogger(__name__) async def draw_meme_text(image_path, text): img = Image.open(image_path) @@ -28,7 +29,7 @@ async def draw_meme_text(image_path, text): current_h, pad = 10, 5 if upper_text: for u_text in textwrap.wrap(upper_text, width=15): - low_test = draw.textlength(text=l_text, font=m_font) + low_test = draw.textlength(text=u_text, font=m_font) LOGGER.info(low_test) u_width, u_height = draw.textlength(text=u_text, font=m_font) draw.text( diff --git a/update.py b/update.py index 9b7ba4cb..6777124f 100644 --- a/update.py +++ b/update.py @@ -7,6 +7,16 @@ import dotenv import requests from git import Repo +logging.basicConfig( + level=INFO, + format="[%(asctime)s - %(levelname)s] - %(name)s.%(funcName)s - %(message)s", + datefmt="%d-%b-%y %H:%M:%S", + handlers=[ + logging.handlers.RotatingFileHandler("MissKatyLogs.txt", mode="w+", maxBytes=1000000), + logging.StreamHandler(), + ], +) + LOGGER = logging.getLogger(__name__) ENV_URL = os.environ.get("ENV_URL")