kllk
This commit is contained in:
@@ -1120,7 +1120,7 @@ def _run_op(op: str, data: Any) -> Dict[str, Any]:
|
||||
|
||||
|
||||
def _append_helper_log(text: str) -> None:
|
||||
"""Log to database instead of file. This provides unified logging with rest of system."""
|
||||
"""Log helper diagnostics to file, database, and the mpv console emitter."""
|
||||
payload = (text or "").rstrip()
|
||||
if not payload:
|
||||
return
|
||||
@@ -1129,6 +1129,12 @@ def _append_helper_log(text: str) -> None:
|
||||
if len(_HELPER_LOG_BACKLOG) > _HELPER_LOG_BACKLOG_LIMIT:
|
||||
del _HELPER_LOG_BACKLOG[:-_HELPER_LOG_BACKLOG_LIMIT]
|
||||
|
||||
try:
|
||||
with open(_helper_log_path(), "a", encoding="utf-8", errors="replace") as fh:
|
||||
fh.write(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] {payload}\n")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
# Try database logging first (best practice: unified logging)
|
||||
from SYS.database import log_to_db
|
||||
|
||||
Reference in New Issue
Block a user