Turned Off Logging

This commit is contained in:
tr1x_em committed 2025-08-07 15:01:09 +05:30
1 parent b07b79796c
commit 37ef0b33be
2 files changed
+20 -12

No files matched your search

+8 -3
View File
@@ -1,11 +1,13 @@
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gdk
# Initialize fontconfig early to prevent warnings
try:
import ctypes
libfontconfig = ctypes.CDLL("libfontconfig.so.1")
libfontconfig.FcInit()
except:
@@ -31,11 +33,14 @@ from modules.switcher import ApplicationSwitcher
for log in [
"fabric.hyprland.widgets",
"fabric.audio.service",
"fabric.bluetooth.service",
"fabric.bluetooth.service",
"services.network",
"utils.wayland",
"modules.notification.notification",
"modules.notification.notification_center",
"modules.controlcenter.player",
"services.brightness",
"modules.controlcenter.expanded_player",
]:
logger.disable(log)
+12 -9
View File
@@ -7,6 +7,7 @@ import re
import threading
import time
from typing import Dict, List, Optional
from loguru import logger
from gi.repository import GdkPixbuf
from PIL import Image
@@ -60,9 +61,9 @@ class WallpaperPlugin(PluginBase):
[f for f in os.listdir(data.WALLPAPERS_DIR) if self._is_image(f)]
)
else:
print(f"Wallpapers directory not found: {data.WALLPAPERS_DIR}")
logger.error(f"Wallpapers directory not found: {data.WALLPAPERS_DIR}")
except Exception as e:
print(f"Error loading wallpapers: {e}")
logger.error(f"Error loading wallpapers: {e}")
def _is_image(self, filename: str) -> bool:
"""Check if file is a supported image format."""
@@ -81,7 +82,7 @@ class WallpaperPlugin(PluginBase):
# File doesn't exist, keep default True
pass
except Exception as e:
print(f"Error reading config file: {e}")
logger.error(f"Error reading config file: {e}")
# Keep default True on error
return self.matugen_enabled
@@ -106,7 +107,7 @@ class WallpaperPlugin(PluginBase):
json.dump(config, f, indent=4)
except Exception as e:
print(f"Error writing matugen state to config: {e}")
logger.error(f"Error writing matugen state to config: {e}")
# Clear the search query after toggling matugen
self._clear_launcher_query()
@@ -164,7 +165,7 @@ class WallpaperPlugin(PluginBase):
return
except Exception as e:
print(f"Could not clear launcher query: {e}")
logger.error(f"Could not clear launcher query: {e}")
def _get_cache_path(self, filename: str) -> str:
"""Get cache path for wallpaper thumbnail."""
@@ -183,7 +184,7 @@ class WallpaperPlugin(PluginBase):
img.thumbnail((32, 32), Image.Resampling.LANCZOS)
img.save(cache_path, "PNG", optimize=True)
except Exception as e:
print(f"Error creating thumbnail for {filename}: {e}")
logger.error(f"Error creating thumbnail for {filename}: {e}")
return None
return cache_path
@@ -205,12 +206,14 @@ class WallpaperPlugin(PluginBase):
)
self.thumbnail_cache[wallpaper] = pixbuf
except Exception as e:
print(f"Error loading thumbnail for {wallpaper}: {e}")
logger.error(
f"Error loading thumbnail for {wallpaper}: {e}"
)
self.thumbnail_cache[wallpaper] = None
else:
self.thumbnail_cache[wallpaper] = None
except Exception as e:
print(f"Error processing thumbnail for {wallpaper}: {e}")
logger.error(f"Error processing thumbnail for {wallpaper}: {e}")
self.thumbnail_cache[wallpaper] = None
finally:
self.thumbnail_loading.discard(wallpaper)
@@ -238,7 +241,7 @@ class WallpaperPlugin(PluginBase):
self.thumbnail_cache[filename] = pixbuf
return pixbuf
except Exception as e:
print(f"Error loading thumbnail for {filename}: {e}")
logger.error(f"Error loading thumbnail for {filename}: {e}")
self.thumbnail_cache[filename] = None
return None