MCPcopy Index your code
hub / github.com/VectifyAI/OpenKB / append_log

Function append_log

openkb/log.py:9–22  ·  view source on GitHub ↗

Append an entry to wiki/log.md. Format: ``## [YYYY-MM-DD HH:MM:SS] operation | description``

(wiki_dir: Path, operation: str, description: str)

Source from the content-addressed store, hash-verified

7
8
9def append_log(wiki_dir: Path, operation: str, description: str) -> None:
10 """Append an entry to wiki/log.md.
11
12 Format: ``## [YYYY-MM-DD HH:MM:SS] operation | description``
13 """
14 log_path = wiki_dir / "log.md"
15 date_str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
16 entry = f"## [{date_str}] {operation} | {description}\n\n"
17
18 if not log_path.exists():
19 log_path.write_text("# Operations Log\n\n" + entry, encoding="utf-8")
20 else:
21 with log_path.open("a", encoding="utf-8") as f:
22 f.write(entry)

Callers 7

_add_single_file_lockedFunction · 0.90
queryFunction · 0.90
removeFunction · 0.90
recompileFunction · 0.90
run_lintFunction · 0.90
run_chatFunction · 0.90

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected