feat: log level in nix

This commit is contained in:
2025-10-17 17:44:49 +02:00
parent 5137379ac9
commit c256931b1d
3 changed files with 10 additions and 3 deletions

View File

@@ -1,15 +1,15 @@
from loguru import logger
# Configure logging based on dev flag
from .config import DEV
from .config import DEV, LOG_LEVEL
if DEV:
# In dev mode, disable fabric logs but keep stylix and bar logs
logger.disable("fabric")
else:
# In production, disable fabric logs but keep bar logs for debugging
# In production, disable fabric logs but keep bar logs with configurable level
import sys
logger.disable("fabric")
logger.configure(handlers=[{"sink": sys.stderr, "level": "INFO", "format": "{time} | {level} | {name}:{function}:{line} - {message}"}])
logger.configure(handlers=[{"sink": sys.stderr, "level": LOG_LEVEL, "format": "{time} | {level} | {name}:{function}:{line} - {message}"}])
from fabric import Application
from fabric.system_tray.widgets import SystemTray