This commit is contained in:
LibraHp_0928 2024-10-11 20:19:41 +08:00
parent eb13f93897
commit 5fc241088b

View File

@ -141,7 +141,7 @@ def log(message,type="info"):
now = time.strftime("%Y-%m-%d %H:%M:%S") now = time.strftime("%Y-%m-%d %H:%M:%S")
log_info_ref.current.value = f"[{now}] - {message}" log_info_ref.current.value = f"[{now}] - {message}"
# 写入日志到文件 # 写入日志到文件
with open("log.txt", "a", encoding="utf-8") as f: with open(f"{save_path}/log.txt", "a", encoding="utf-8") as f:
f.write(f"[{now}] - {message}\n") f.write(f"[{now}] - {message}\n")
if type == "success": if type == "success":
log_info_ref.current.color = "green" log_info_ref.current.color = "green"