prod logging

This commit is contained in:
2025-09-30 00:35:27 +02:00
parent 2d3f97cae1
commit 0be71cfddf
3 changed files with 29 additions and 19 deletions

View File

@@ -6,10 +6,10 @@ if DEV:
# In dev mode, disable fabric logs but keep stylix and bar logs
logger.disable("fabric")
else:
# In production, disable all debug logs, only keep warnings and errors
# In production, disable fabric logs but keep bar logs for debugging
import sys
logger.disable("fabric")
logger.disable("bar")
logger.configure(handlers=[{"sink": lambda msg: print(msg, end=""), "level": "WARNING"}])
logger.configure(handlers=[{"sink": sys.stderr, "level": "INFO", "format": "{time} | {level} | {name}:{function}:{line} - {message}"}])
from fabric import Application
from fabric.system_tray.widgets import SystemTray