mirror of
https://github.com/hoshikawa2/rfp_response_automation.git
synced 2026-03-03 16:09:35 +00:00
11 lines
358 B
Python
11 lines
358 B
Python
from flask import session, request
|
|
from datetime import datetime
|
|
|
|
def audit_log(action: str, detail: str = ""):
|
|
email = session.get("user_email", "anonymous")
|
|
ip = request.remote_addr
|
|
|
|
line = f"{datetime.utcnow().isoformat()} | {email} | {ip} | {action} | {detail}\n"
|
|
|
|
with open("audit.log", "a", encoding="utf-8") as f:
|
|
f.write(line) |