重新设置日志文件路径输出
This commit is contained in:
parent
7c9f36db3e
commit
60ef5bd7e9
|
|
@ -11,6 +11,7 @@ import webview
|
|||
|
||||
# 获取当前脚本所在的目录
|
||||
new_java_path = 'D:/database/jdk/bin/java.exe'
|
||||
app_log_dir = 'D:/database/logs'
|
||||
port = 12396
|
||||
def get_resource_path(relative_path):
|
||||
""" 获取资源绝对路径,适用于开发环境和PyInstaller打包后 """
|
||||
|
|
@ -33,7 +34,7 @@ def start():
|
|||
creation_flags = subprocess.CREATE_NEW_PROCESS_GROUP
|
||||
# 重定向输出到日志文件
|
||||
formatted_time = datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
log_file = rf'D:\database\app_{formatted_time}.log'
|
||||
log_file = rf'{app_log_dir}\app_{formatted_time}.log'
|
||||
with open(log_file, "a") as log:
|
||||
process = subprocess.Popen(
|
||||
java_command,
|
||||
|
|
|
|||
Loading…
Reference in New Issue