MCPcopy Create free account
hub / github.com/StarsTom/mobileCodexHelper / tail_error_lines

Function tail_error_lines

mobile_codex_control.py:603–610  ·  view source on GitHub ↗
(limit: int = 8)

Source from the content-addressed store, hash-verified

601
602
603def tail_error_lines(limit: int = 8) -> list[str]:
604 combined = []
605 for label, path in (("后端", APP_STDERR_LOG), ("nginx", NGINX_ERROR_LOG)):
606 lines = tail_lines(path, max_lines=40)
607 interesting = [line for line in lines if re.search(r"error|warn|fail|502|trace|deprecat", line, re.I)]
608 if interesting:
609 combined.extend([f"[{label}] {line}" for line in interesting[-4:]])
610 return combined[-limit:]
611
612
613def open_auth_db() -> sqlite3.Connection:

Callers 1

collect_statusFunction · 0.85

Calls 1

tail_linesFunction · 0.85

Tested by

no test coverage detected