GodsDevProject's picture
Update audit.py
7425118 verified
raw
history blame contribute delete
429 Bytes
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)