mirror of
https://github.com/plexguide/Huntarr.io.git
synced 2026-02-23 07:08:45 -06:00
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:
@@ -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").
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user