File size: 429 Bytes
0db0866 2996e92 0db0866 2996e92 7425118 0db0866 2996e92 7425118 0db0866 2996e92 0db0866 7425118 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import uuid
from datetime import datetime
from typing import Dict, List
_AUDIT_LOG: List[Dict] = []
def log_event(action: str, payload: Dict) -> Dict:
entry = {
"id": str(uuid.uuid4()),
"timestamp": datetime.utcnow().isoformat() + "Z",
"action": action,
"payload": payload
}
_AUDIT_LOG.append(entry)
return entry
def export_audit_log() -> List[Dict]:
return list(_AUDIT_LOG) |