From 299e74ebd54d539ceac7de790fcc221fbaab290d Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 28 May 2025 09:17:21 -0700 Subject: [PATCH] style: Replace emojis with tags in diagnostics logs --- utils/diagnostics.py | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/utils/diagnostics.py b/utils/diagnostics.py index d3f2882..5620309 100644 --- a/utils/diagnostics.py +++ b/utils/diagnostics.py @@ -20,7 +20,7 @@ class GalleryDiagnostics: def run_full_diagnostic(self) -> Dict[str, Any]: """Run a complete diagnostic check.""" self.logger.info("\n" + "="*60) - self.logger.info("๐Ÿ” PROMPTMANAGER GALLERY DIAGNOSTICS") + self.logger.info("[DIAG] PROMPTMANAGER GALLERY DIAGNOSTICS") self.logger.info("="*60) results = { @@ -32,11 +32,11 @@ class GalleryDiagnostics: } self.logger.info("\n" + "="*60) - self.logger.info("๐Ÿ“‹ DIAGNOSTIC SUMMARY") + self.logger.info("[SUMMARY] DIAGNOSTIC SUMMARY") self.logger.info("="*60) for category, result in results.items(): - status = "โœ… PASS" if result['status'] == 'ok' else "โŒ FAIL" + status = "[PASS] PASS" if result['status'] == 'ok' else "[FAIL] FAIL" self.logger.info(f"{category.upper():<20} {status}") if result['status'] != 'ok': self.logger.warning(f" Issue: {result['message']}") @@ -46,7 +46,7 @@ class GalleryDiagnostics: def check_database(self) -> Dict[str, Any]: """Check database connection and structure.""" - self.logger.info("\n๐Ÿ—„๏ธ Checking Database...") + self.logger.info("\n[DB] Checking Database...") try: if not os.path.exists(self.db_path): @@ -61,7 +61,7 @@ class GalleryDiagnostics: # Check prompts table cursor = conn.execute("SELECT COUNT(*) as count FROM prompts") prompt_count = cursor.fetchone()['count'] - self.logger.info(f" ๐Ÿ“ Prompts in database: {prompt_count}") + self.logger.info(f" [NOTE] Prompts in database: {prompt_count}") # Check if generated_images table exists cursor = conn.execute(""" @@ -70,7 +70,7 @@ class GalleryDiagnostics: """) has_images_table = cursor.fetchone() is not None - self.logger.info(f" ๐Ÿ–ผ๏ธ Images table exists: {has_images_table}") + self.logger.info(f" [IMG] Images table exists: {has_images_table}") return { 'status': 'ok', @@ -86,7 +86,7 @@ class GalleryDiagnostics: def check_images_table(self) -> Dict[str, Any]: """Check the generated_images table specifically.""" - self.logger.info("\n๐Ÿ–ผ๏ธ Checking Images Table...") + self.logger.info("\n[IMG] Checking Images Table...") try: with sqlite3.connect(self.db_path) as conn: @@ -107,7 +107,7 @@ class GalleryDiagnostics: # Check image records cursor = conn.execute("SELECT COUNT(*) as count FROM generated_images") image_count = cursor.fetchone()['count'] - self.logger.info(f" ๐Ÿ“Š Images in database: {image_count}") + self.logger.info(f" [STATS] Images in database: {image_count}") # Get recent images cursor = conn.execute(""" @@ -119,7 +119,7 @@ class GalleryDiagnostics: """) recent_images = [dict(row) for row in cursor.fetchall()] - self.logger.info(f" ๐Ÿ•’ Recent images: {len(recent_images)}") + self.logger.info(f" [TIME] Recent images: {len(recent_images)}") for img in recent_images: self.logger.info(f" - {img['filename']} -> Prompt {img['prompt_id']}") @@ -137,12 +137,12 @@ class GalleryDiagnostics: def check_file_system(self) -> Dict[str, Any]: """Check file system and permissions.""" - self.logger.info("\n๐Ÿ“ Checking File System...") + self.logger.info("\n[DIR] Checking File System...") try: # Check current directory current_dir = os.getcwd() - self.logger.info(f" ๐Ÿ“‚ Current directory: {current_dir}") + self.logger.info(f" [FOLDER] Current directory: {current_dir}") # Check if we can write to current directory test_file = "test_write.tmp" @@ -154,7 +154,7 @@ class GalleryDiagnostics: except: can_write = False - self.logger.info(f" โœ๏ธ Can write to directory: {can_write}") + self.logger.info(f" [EDIT] Can write to directory: {can_write}") return { 'status': 'ok', @@ -170,7 +170,7 @@ class GalleryDiagnostics: def check_comfyui_output(self) -> Dict[str, Any]: """Check ComfyUI output directories.""" - self.logger.info("\n๐ŸŽจ Checking ComfyUI Output...") + self.logger.info("\n[STYLE] Checking ComfyUI Output...") output_dirs = [] @@ -188,16 +188,16 @@ class GalleryDiagnostics: abs_path = os.path.abspath(dir_path) if os.path.exists(abs_path): output_dirs.append(abs_path) - self.logger.info(f" ๐Ÿ“ Found output dir: {abs_path}") + self.logger.info(f" [DIR] Found output dir: {abs_path}") # Count images in this directory try: image_files = [] for ext in ['.png', '.jpg', '.jpeg', '.webp']: image_files.extend(Path(abs_path).rglob(f'*{ext}')) - self.logger.info(f" ๐Ÿ–ผ๏ธ Images found: {len(image_files)}") + self.logger.info(f" [IMG] Images found: {len(image_files)}") except Exception as e: - self.logger.error(f" โŒ Error scanning: {e}") + self.logger.error(f" [FAIL] Error scanning: {e}") # Try ComfyUI's folder_paths try: @@ -205,9 +205,9 @@ class GalleryDiagnostics: comfyui_output = folder_paths.get_output_directory() if comfyui_output and comfyui_output not in output_dirs: output_dirs.append(comfyui_output) - self.logger.info(f" ๐Ÿ“ ComfyUI output dir: {comfyui_output}") + self.logger.info(f" [DIR] ComfyUI output dir: {comfyui_output}") except ImportError: - self.logger.warning(" โš ๏ธ ComfyUI folder_paths not available") + self.logger.warning(" [WARN] ComfyUI folder_paths not available") return { 'status': 'ok' if output_dirs else 'warning', @@ -217,7 +217,7 @@ class GalleryDiagnostics: def check_dependencies(self) -> Dict[str, Any]: """Check required dependencies.""" - self.logger.info("\n๐Ÿ“ฆ Checking Dependencies...") + self.logger.info("\n[PKG] Checking Dependencies...") dependencies = { 'watchdog': False, @@ -229,25 +229,25 @@ class GalleryDiagnostics: try: import watchdog dependencies['watchdog'] = True - self.logger.info(f" โœ… watchdog: {watchdog.__version__}") + self.logger.info(f" [PASS] watchdog: {watchdog.__version__}") except ImportError: - self.logger.error(" โŒ watchdog: NOT INSTALLED") + self.logger.error(" [FAIL] watchdog: NOT INSTALLED") # Check PIL try: from PIL import Image dependencies['PIL'] = True - self.logger.info(f" โœ… PIL (Pillow): Available") + self.logger.info(f" [PASS] PIL (Pillow): Available") except ImportError: - self.logger.error(" โŒ PIL (Pillow): NOT AVAILABLE") + self.logger.error(" [FAIL] PIL (Pillow): NOT AVAILABLE") # Check sqlite3 try: import sqlite3 dependencies['sqlite3'] = True - self.logger.info(f" โœ… sqlite3: {sqlite3.sqlite_version}") + self.logger.info(f" [PASS] sqlite3: {sqlite3.sqlite_version}") except ImportError: - self.logger.error(" โŒ sqlite3: NOT AVAILABLE") + self.logger.error(" [FAIL] sqlite3: NOT AVAILABLE") all_deps_ok = all(dependencies.values()) @@ -259,7 +259,7 @@ class GalleryDiagnostics: def create_test_image_link(self, prompt_id: int, test_image_path: str = None) -> Dict[str, Any]: """Create a test image link to verify the system works.""" - self.logger.info(f"\n๐Ÿงช Creating test image link for prompt {prompt_id}...") + self.logger.info(f"\n[TEST] Creating test image link for prompt {prompt_id}...") try: # Import database operations @@ -292,7 +292,7 @@ class GalleryDiagnostics: metadata=test_metadata ) - self.logger.info(f" โœ… Test image linked with ID: {image_id}") + self.logger.info(f" [PASS] Test image linked with ID: {image_id}") return { 'status': 'ok',