Files
VRCWT-OSC/VRWT_Tool/VRC_OSC/src/common/runtime_log.py
2026-06-24 00:38:14 +09:00

20 lines
494 B
Python

from datetime import datetime
from common.project_paths import RUNTIME_LOG_FILE
def appendRuntimeLog(title, text):
RUNTIME_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_LOG_FILE.open("a", encoding="utf-8") as file:
file.write(f"\n[{now}] {title}\n")
file.write(body)
file.write("\n")
return RUNTIME_LOG_FILE