解决log_text过长导致的log显示于中间

This commit is contained in:
DLmaster
2024-11-09 11:15:44 +08:00
parent 0141bf039a
commit fb27c50c75

View File

@@ -185,6 +185,7 @@ class MaaRunner(QtCore.QThread):
# 合并日志
log = "".join(logs)
# 更新MAA日志
if len(logs) > 10000:
self.update_gui.emit(
self.data[index][0]
+ "_第"
@@ -194,7 +195,19 @@ class MaaRunner(QtCore.QThread):
"\n".join([self.data[_][0] for _ in wait_index]),
"\n".join([self.data[_][0] for _ in over_index]),
"\n".join([self.data[_][0] for _ in error_index]),
log,
"".join(logs[-10000:]),
)
else:
self.update_gui.emit(
self.data[index][0]
+ "_第"
+ str(i + 1)
+ "次_"
+ mode_book[j][5:7],
"\n".join([self.data[_][0] for _ in wait_index]),
"\n".join([self.data[_][0] for _ in over_index]),
"\n".join([self.data[_][0] for _ in error_index]),
"".join(logs),
)
# 判断MAA程序运行状态
result = self.if_maa_success(log, mode_book[j])
@@ -307,12 +320,29 @@ class MaaRunner(QtCore.QThread):
# 合并日志
log = "".join(logs)
# 更新MAA日志
if len(logs) > 10000:
self.update_gui.emit(
self.data[index][0],
self.data[index][0]
+ "_第"
+ str(i + 1)
+ "次_"
+ mode_book[j][5:7],
"\n".join([self.data[_][0] for _ in wait_index]),
"\n".join([self.data[_][0] for _ in over_index]),
"\n".join([self.data[_][0] for _ in error_index]),
log,
"".join(logs[-10000:]),
)
else:
self.update_gui.emit(
self.data[index][0]
+ "_第"
+ str(i + 1)
+ "次_"
+ mode_book[j][5:7],
"\n".join([self.data[_][0] for _ in wait_index]),
"\n".join([self.data[_][0] for _ in over_index]),
"\n".join([self.data[_][0] for _ in error_index]),
"".join(logs),
)
# 判断MAA程序运行状态
result = self.if_maa_success(log, "人工排查")