#
#
#
# alert_util.cfv
#
#
# alert_util_convert_node_to_string()
# alert_util_get_bug_report_as_node()
#
#
#
#
#
#
#
#
# alert_util_convert_node_to_string()
#
#
#
subroutine(alert_util_convert_node_to_string(
node the_node), (
# Converts the given node to a string
node item;
foreach item the_node (
if (num_subnodes(item) == 0) then (
node_name(item) . ': ' . @item . '\n';
)
else (
alert_util_convert_node_to_string(item);
);
);
));
#
#
#
# alert_util_get_bug_report_as_node()
#
#
#
subroutine(alert_util_get_bug_report_as_node(
string alert_id), (
# Returns a node with all relevant bug report data, this replaces compose_bug_report_text()
string message_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_message.txt";
string traceback_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_traceback.txt";
string info_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_info.txt";
string error_message = read_file(message_file);
string error_traceback = read_file(traceback_file);
string error_info_text = read_file(info_file);
string licensing_features_text = alert_util_convert_node_to_string("volatile.licensing.features");
# debug_message("\n\n" . node_as_string("volatile.licensing.features") . "\n\n");
bool is_webserver_mode = !CGI_MODE;
string operation_mode;
if (is_webserver_mode) then (
operation_mode = "Webserver Mode";
)
else (
operation_mode = "CGI Mode";
);
#*
string bug_report = "MESSAGE
" . error_message . "
";
bug_report .= "TRACEBACK
" . error_traceback . "
";
# 2008-12-28 - GMF - Added expand(); otherwise we get Salang code in the emails we receive (because PRODUCT_NAME has embedded Salang).
bug_report .= expand("SYSTEM
" . PRODUCT_NAME . " " . VERSION . " (" . ARCH . ", " . operation_mode . ")
");
bug_report .= "LICENSING
" . licensing_features_text . "
";
bug_report .= "INFO
" . error_info_text . "