From ea007aa4297c0cab69d3ec7675aee66e51a3ca7e Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 11 九月 2023 12:16:59 +0800 Subject: [PATCH] 系统日志添加保护 --- log_module/log_export.py | 15 +++++++++------ l2/l2_data_manager_new.py | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index fd14007..f195673 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -347,7 +347,6 @@ # l2_data_log.l2_time(code, round(t.time() * 1000) - origin_start_time, # "l2鏁版嵁澶勭悊鎬昏�楁椂", # True) - pass if datas: l2.l2_data_util.save_l2_data(code, None, datas) diff --git a/log_module/log_export.py b/log_module/log_export.py index f387fc1..8e14d41 100644 --- a/log_module/log_export.py +++ b/log_module/log_export.py @@ -333,12 +333,15 @@ lines = f.readlines() for line in lines: if line: - time_str = line.split("|")[0].strip() - level = line.split("|")[1].strip() - if level != "INFO" and level != "ERROR": - continue - data = line.split("|")[2].split(" - ")[1].strip() - fdatas.append((time_str, level, data)) + try: + time_str = line.split("|")[0].strip() + level = line.split("|")[1].strip() + if level != "INFO" and level != "ERROR": + continue + data = line.split("|")[2].split(" - ")[1].strip() + fdatas.append((time_str, level, data)) + except: + pass return fdatas -- Gitblit v1.8.0