# # # # save_alert_message() # # # include "templates.util.alert.get_error_info_text"; subroutine(save_alert_message( string error_message, string error_traceback), ( # Saves the error_message, error_traceback and error_info in files on disk and returns the alert_id string alert_id = md5_digest(now_us() . error_message . error_traceback); # # # handle error_message # # string message_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_message.txt"; int message_handle = open_file(message_file, "w"); write_string_to_file(message_handle, error_message); close_file(message_handle); # # # handle error_traceback # # string traceback_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_traceback.txt"; int traceback_handle = open_file(traceback_file, "w"); write_string_to_file(traceback_handle, error_traceback); close_file(traceback_handle); # # # handle error_info # # string error_info_text = get_error_info_text(); string info_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_info.txt"; int info_handle = open_file(info_file, "w"); write_string_to_file(info_handle, error_info_text); close_file(info_handle); # # # Return alert_id # # alert_id; ));