MCPcopy Create free account
hub / github.com/Emmimal/control-layer / log

Method log

control_layer.py:730–737  ·  view source on GitHub ↗
(self, record: AuditRecord)

Source from the content-addressed store, hash-verified

728 log.warning("audit.load_failed", error=str(exc))
729
730 def log(self, record: AuditRecord) -> None:
731 with self._lock:
732 self._records.append(record)
733 try:
734 with open(self._path, "a", encoding="utf-8") as f:
735 f.write(json.dumps(record.to_dict()) + "\n")
736 except Exception as exc:
737 log.error("audit.write_failed", error=str(exc))
738
739 def all_records(self) -> List[AuditRecord]:
740 with self._lock:

Callers 6

test_log_and_retrieveMethod · 0.95
test_persists_to_fileMethod · 0.95
test_pass_rateMethod · 0.95
_log_recordMethod · 0.80
writeMethod · 0.80

Calls 2

writeMethod · 0.80
to_dictMethod · 0.80

Tested by 5

test_log_and_retrieveMethod · 0.76
test_persists_to_fileMethod · 0.76
test_pass_rateMethod · 0.76
writeMethod · 0.64