perf:优化CPLD事件显示
This commit is contained in:
parent
cbdf0cabf4
commit
a11865d6da
@ -197,7 +197,9 @@ def parse_error_event_to_json(log_str, level):
|
||||
return
|
||||
|
||||
# 故障事件判定
|
||||
json_record["title"] = f"故障事件-{log_dict['sensor']}"
|
||||
if "Index:" in log_dict['sensor'] or log_dict['sensor'] == "Power" or log_dict['sensor'] == "Abnormal":
|
||||
details_info["Sensor"] = "CPLD事件"
|
||||
json_record["title"] = f"故障事件-{details_info['Sensor']}"
|
||||
json_record["details"] = details_info
|
||||
json_str = json.dumps(json_record, indent=2, ensure_ascii=False)
|
||||
add_data_to_json(json_str)
|
||||
|
||||
@ -71,6 +71,10 @@ def process_log_with_keywords(file_path, keywords, json_output_path=cache_sys_er
|
||||
# 添加行号信息,方便追溯
|
||||
parsed['line_number'] = line_number
|
||||
parsed_results.append(parsed)
|
||||
|
||||
# 添加对sensor信息的校验
|
||||
if "Index:" in parsed['sensor'] or parsed['sensor'] == "Power" or parsed['sensor'] == "Abnormal":
|
||||
parsed['sensor'] = "CPLD事件"
|
||||
# print("提取的信息:")
|
||||
# for key, value in parsed.items():
|
||||
# print(f" {key}: {value}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user