From 79aaa6e4f48cd932c04dca4721f570f0cb92b24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Wed, 23 Mar 2022 18:35:35 +0100 Subject: [PATCH] feat: some loggings --- src/database.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/database.py b/src/database.py index 3af98a2..e2dcca8 100644 --- a/src/database.py +++ b/src/database.py @@ -1,4 +1,5 @@ import io +import logging import sqlite3 import uuid @@ -9,13 +10,16 @@ DATA_FOLDER = "data/" def take_screenshot(device): result = device.screencap() + logging.debug("screenshot taken") image = Image.open(io.BytesIO(result)) image = image.crop((0, 160, 2200, 860)) image.thumbnail((150, 150)) + logging.debug("screenshot converted") # image = image.resize((150, 150), Image.ANTIALIAS) filename = uuid.uuid1() image.save(f"{DATA_FOLDER}/{filename}.png") + logging.debug("screenshot saved") return filename