From 9c9970b9301aa14698e0b0a9f77154403b98e617 Mon Sep 17 00:00:00 2001 From: mst Date: Tue, 26 Nov 2024 15:10:14 +0300 Subject: [PATCH] use `app.logger.debug()` instead of `print()` --- functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.py b/functions.py index 2c1021c..644ff99 100644 --- a/functions.py +++ b/functions.py @@ -271,7 +271,7 @@ def find_emoji_path(emoji_name): else: for address, dirs, files in os.walk(EMOJI_BASE_PATH): - print("\n[CatAsk/functions/find_emoji_path] Falling back to scanning directories\n") + app.logger.debug("\n[CatAsk/functions/find_emoji_path] Falling back to scanning directories\n") if f"{emoji_name}.png" in files: rel_dir = os.path.relpath(address, EMOJI_BASE_PATH) emoji_path = os.path.join("static/emojis", rel_dir, f"{emoji_name}.png") @@ -332,7 +332,7 @@ def listEmojiPacks(): # Check if a meta.json file exists in the directory meta_json_path = const.emojiPath / f"{pack_dir}.json" if meta_json_path.exists(): - print(f"[CatAsk/functions/listEmojiPacks] Using meta.json file ({meta_json_path})") + app.logger.debug(f"[CatAsk/functions/listEmojiPacks] Using meta.json file ({meta_json_path})") # Load data from the meta.json file pack_data = loadJSON(meta_json_path) @@ -345,7 +345,7 @@ def listEmojiPacks(): 'emojis': pack_data.get('emojis', []) }) else: - print(f"[CatAsk/functions/listEmojiPacks] Falling back to directory scan ({pack_dir})") + app.logger.debug(f"[CatAsk/functions/listEmojiPacks] Falling back to directory scan ({pack_dir})") # If no meta.json is found, fall back to directory scan preview_image = None # Find the first image in the directory for preview @@ -380,7 +380,7 @@ def processEmojis(meta_json_path): 'file_name': emoji['fileName'], } processed_emojis.append(emoji_info) - print(f"[CatAsk/API/upload_emoji_pack] Processed emoji: {emoji_info['name']}\t(File: {emoji_info['file_name']})") + app.logger.debug(f"[CatAsk/API/upload_emoji_pack] Processed emoji: {emoji_info['name']}\t(File: {emoji_info['file_name']})") # Create the pack info structure pack_info = {