refactor: standardize logger name formatting to lowercase in log streaming and adjust log level for successful stats writes to DEBUG

This commit is contained in:
Admin9705
2025-05-29 05:29:30 +02:00
parent 0bf3d545be
commit b58c9b69f2
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -641,3 +641,4 @@ The smart `cyclelock` system provides reliable cycle state tracking:
- "*** STATS ONLY INCREMENT ***" messages in `stats_manager.py`
- "*** STATS INCREMENT ***" messages in app-specific files (e.g., `sonarr/missing.py`, `sonarr/upgrade.py`)
- "Successfully incremented and verified" messages in `stats_manager.py`
6. **Logger name formatting consistency**: Use lowercase for logger name prefixes in log streaming. Change `name.upper()` to `name.lower()` in `web_server.py` log stream generator to ensure consistent formatting (e.g., "huntarr.hunting" instead of "HUNTARR.HUNTING").
+1 -1
View File
@@ -372,7 +372,7 @@ def save_stats(stats: Dict[str, Dict[str, int]]) -> bool:
# Move the temp file to the actual file
os.replace(temp_file, STATS_FILE)
logger.info(f"===> Successfully wrote stats to file: {STATS_FILE}")
logger.debug(f"===> Successfully wrote stats to file: {STATS_FILE}")
logger.debug(f"Stats saved successfully: {stats}")
return True
except Exception as e:
+1 -1
View File
@@ -508,7 +508,7 @@ def logs_stream():
for line in new_lines:
stripped = line.strip()
if stripped:
prefix = f"[{name.upper()}] " if app_type == 'all' else ""
prefix = f"[{name.lower()}] " if app_type == 'all' else ""
yield f"data: {prefix}{stripped}\n\n"
except FileNotFoundError: