MCPcopy Index your code
hub / github.com/github/spec-kit / append_log

Method append_log

src/specify_cli/workflows/engine.py:549–561  ·  view source on GitHub ↗

Append a log entry to the run log. Held under ``_log_lock`` so concurrent fan-out workers serialize their list append and ``log.jsonl`` write rather than interleaving lines.

(self, entry: dict[str, Any])

Source from the content-addressed store, hash-verified

547 return state
548
549 def append_log(self, entry: dict[str, Any]) -> None:
550 """Append a log entry to the run log.
551
552 Held under ``_log_lock`` so concurrent fan-out workers serialize their
553 list append and ``log.jsonl`` write rather than interleaving lines.
554 """
555 entry["timestamp"] = datetime.now(timezone.utc).isoformat()
556 runs_dir = self.runs_dir
557 runs_dir.mkdir(parents=True, exist_ok=True)
558 with self._log_lock:
559 self.log_entries.append(entry)
560 with open(runs_dir / "log.jsonl", "a", encoding="utf-8") as f:
561 f.write(json.dumps(entry) + "\n")
562
563
564# -- Workflow Engine ------------------------------------------------------

Callers 4

executeMethod · 0.95
test_append_logMethod · 0.95
resumeMethod · 0.80
_execute_stepsMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_append_logMethod · 0.76