Bedre tag sync

This commit is contained in:
2026-04-13 15:33:01 +02:00
parent cb204baa50
commit b066b6d92c
5 changed files with 90 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
"""
app_logger.py Central logging til fil i stedet for konsol.
P<EFBFBD> Windows uden konsol skrives alt til ~/.linedance/app.log
app_logger.py - Central logging til fil i stedet for konsol.
Paa Windows uden konsol skrives alt til ~/.linedance/app.log
"""
import logging
@@ -13,10 +13,9 @@ LOG_PATH = Path.home() / ".linedance" / "app.log"
def setup_logging():
LOG_PATH.parent.mkdir(parents=True, exist_ok=True)
handlers = [logging.FileHandler(LOG_PATH, encoding="utf-8")]
# Kun tilføj konsol-handler hvis vi kører med konsol (development)
if sys.stdout and hasattr(sys.stdout, 'write'):
try:
sys.stdout.write("") # test om konsol virker
sys.stdout.write("")
handlers.append(logging.StreamHandler(sys.stdout))
except Exception:
pass