Update 2025-05-21_08:58:06
This commit is contained in:
2
log.py
2
log.py
@ -9,7 +9,7 @@ def log_violation(event: str, ip: str, uid: str, reason: str):
|
||||
timestamp = datetime.utcnow().isoformat()
|
||||
log_dir = os.path.join(os.path.dirname(__file__), "log")
|
||||
os.makedirs(log_dir, exist_ok=True)
|
||||
log_path = os.path.join(log_dir, "log.txt")
|
||||
log_path = os.path.join(log_dir, "abuse.log")
|
||||
log_entry = f"[{timestamp}] {event} IP={ip} UID={uid} REASON={reason}\n"
|
||||
with open(log_path, "a") as f:
|
||||
f.write(log_entry)
|
||||
|
Reference in New Issue
Block a user