refactor: basic logging

This commit is contained in:
2026-11-05 22:09:19 +01:00
parent 82ccc1d2e8
commit d2d2095081
4 changed files with 21 additions and 4 deletions
+4
View File
@@ -1,8 +1,11 @@
import logging
from PIL import Image, ImageDraw
from ..display import get_display
from ..forge_data import ForgeData
log = logging.getLogger(__name__)
def debug_image(im: Image.Image) -> None:
im = im.resize((1280, 640)).convert("RGB")
@@ -15,6 +18,7 @@ def debug_image(im: Image.Image) -> None:
draw2.line((0, y * 10, 1280, y * 10), fill=(50, 50, 50))
im.resize((1280, 640)).save("debug.png")
log.info("Debug image saved as debug.png")
def main():
+5
View File
@@ -1,3 +1,5 @@
import logging
from PIL import ImageDraw
from ..constants import (
@@ -6,6 +8,7 @@ from ..constants import (
)
from ..display import BLANK_IMG, FONT_1, FONT_2
log = logging.getLogger(__name__)
def generate_loading_image() -> None:
im = BLANK_IMG.copy()
@@ -16,6 +19,7 @@ def generate_loading_image() -> None:
draw.rectangle((24, 35, 104, 40), outline="white", fill="black")
im.save(LOADING_IMG_PATH)
log.info(f"Generated {LOADING_IMG_PATH}")
def generate_background_image() -> None:
@@ -53,6 +57,7 @@ def generate_background_image() -> None:
draw.circle((71, 61), 2, outline="white", fill="black")
im.save(BACKGROUND_IMG_PATH)
log.info(f"Generated {BACKGROUND_IMG_PATH}")
def main():