(self)
| 714 | self._load_existing() |
| 715 | |
| 716 | def _load_existing(self) -> None: |
| 717 | if self._path.exists(): |
| 718 | with self._lock: |
| 719 | try: |
| 720 | with open(self._path, "r", encoding="utf-8") as f: |
| 721 | for line in f: |
| 722 | line = line.strip() |
| 723 | if line: |
| 724 | # Reconstruct for in-memory analytics only |
| 725 | # Full record is in the file |
| 726 | pass |
| 727 | except Exception as exc: |
| 728 | log.warning("audit.load_failed", error=str(exc)) |
| 729 | |
| 730 | def log(self, record: AuditRecord) -> None: |
| 731 | with self._lock: |