MCPcopy Index your code
hub / github.com/VitoHowe/glm-coding / _write_entry

Method _write_entry

app/runtime_logging.py:262–271  ·  view source on GitHub ↗
(self, entry: dict[str, Any])

Source from the content-addressed store, hash-verified

260 }
261
262 def _write_entry(self, entry: dict[str, Any]) -> None:
263 date_part = str(entry.get("date") or datetime.now().strftime("%Y-%m-%d"))
264 payload = json.dumps(entry, ensure_ascii=False, separators=(",", ":"))
265 with self._lock:
266 self._append_line(self.settings.runtime_logs_dir / f"events-{date_part}.jsonl", payload)
267 account_id = str(entry.get("account_id") or "").strip()
268 if account_id and account_id != "system":
269 account_dir = self.settings.runtime_logs_dir / "accounts" / account_id
270 account_dir.mkdir(parents=True, exist_ok=True)
271 self._append_line(account_dir / f"{date_part}.jsonl", payload)
272
273 def _append_line(self, path: Path, line: str) -> None:
274 path.parent.mkdir(parents=True, exist_ok=True)

Callers 2

log_eventMethod · 0.95
log_system_eventMethod · 0.95

Calls 1

_append_lineMethod · 0.95

Tested by

no test coverage detected