forked from gooberinc/goober
added more logging to image gen
This commit is contained in:
parent
97cdd7be79
commit
541c19e3ad
2 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ from textwrap import wrap
|
||||||
import logging
|
import logging
|
||||||
from modules.settings import instance as settings_manager
|
from modules.settings import instance as settings_manager
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
|
|
||||||
logger = logging.getLogger("goober")
|
logger = logging.getLogger("goober")
|
||||||
|
|
||||||
|
@ -88,6 +89,7 @@ class BreakingNews(commands.Cog):
|
||||||
await ctx.send(content="Breaking news!", file=discord.File(f))
|
await ctx.send(content="Breaking news!", file=discord.File(f))
|
||||||
|
|
||||||
def __insert_text(self, text):
|
def __insert_text(self, text):
|
||||||
|
start = time.time()
|
||||||
base_image_data: Image.ImageFile.ImageFile = Image.open(
|
base_image_data: Image.ImageFile.ImageFile = Image.open(
|
||||||
os.path.join("assets", "images", "breaking_news.png")
|
os.path.join("assets", "images", "breaking_news.png")
|
||||||
)
|
)
|
||||||
|
@ -130,6 +132,8 @@ class BreakingNews(commands.Cog):
|
||||||
with open(path, "wb") as f:
|
with open(path, "wb") as f:
|
||||||
base_image_data.save(f)
|
base_image_data.save(f)
|
||||||
|
|
||||||
|
logger.info(f"Generation took {time.time() - start}s")
|
||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
assets/images/cache/breaking_news.png
vendored
BIN
assets/images/cache/breaking_news.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 2 MiB After Width: | Height: | Size: 2 MiB |
Loading…
Add table
Add a link
Reference in a new issue