Port
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from common.project_paths import RUNTIME_LOG_FILE
|
||||
from common.project_paths import RUNTIME_JOIN_LEAVE_LOG_FILE
|
||||
|
||||
|
||||
def appendRuntimeLog(title, text):
|
||||
@@ -17,3 +18,19 @@ def appendRuntimeLog(title, text):
|
||||
file.write("\n")
|
||||
|
||||
return RUNTIME_LOG_FILE
|
||||
|
||||
|
||||
def appendJoinLeaveLog(text):
|
||||
RUNTIME_JOIN_LEAVE_LOG_FILE.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
body = str(text).strip()
|
||||
if not body:
|
||||
body = "(empty)"
|
||||
|
||||
with RUNTIME_JOIN_LEAVE_LOG_FILE.open("a", encoding="utf-8") as file:
|
||||
file.write(f"\n[{now}] VRC JOIN/LEAVE\n")
|
||||
file.write(body)
|
||||
file.write("\n")
|
||||
|
||||
return RUNTIME_JOIN_LEAVE_LOG_FILE
|
||||
|
||||
Reference in New Issue
Block a user