| 1164 | } |
| 1165 | |
| 1166 | void |
| 1167 | log_xml_diff(unsigned int log_level, xmlNode *diff, const char *function) |
| 1168 | { |
| 1169 | xmlNode *child = NULL; |
| 1170 | xmlNode *added = find_xml_node(diff, "diff-added", FALSE); |
| 1171 | xmlNode *removed = find_xml_node(diff, "diff-removed", FALSE); |
| 1172 | gboolean is_first = TRUE; |
| 1173 | int options = xml_log_option_formatted; |
| 1174 | |
| 1175 | static struct qb_log_callsite *diff_cs = NULL; |
| 1176 | |
| 1177 | if(diff_cs == NULL) { |
| 1178 | diff_cs = qb_log_callsite_get(function, __FILE__, "xml-diff", log_level, __LINE__, 0); |
| 1179 | } |
| 1180 | |
| 1181 | if (crm_is_callsite_active(diff_cs, log_level, 0) == FALSE) { |
| 1182 | return; |
| 1183 | } |
| 1184 | |
| 1185 | if(log_level < LOG_DEBUG || function == NULL) { |
| 1186 | options |= xml_log_option_diff_short; |
| 1187 | } |
| 1188 | for(child = __xml_first_child(removed); child != NULL; child = __xml_next(child)) { |
| 1189 | log_data_element(log_level, __FILE__, function, __LINE__, "- ", child, 0, options|xml_log_option_diff_minus); |
| 1190 | if(is_first) { |
| 1191 | is_first = FALSE; |
| 1192 | } else { |
| 1193 | do_crm_log(log_level, " --- "); |
| 1194 | } |
| 1195 | } |
| 1196 | |
| 1197 | is_first = TRUE; |
| 1198 | for(child = __xml_first_child(added); child != NULL; child = __xml_next(child)) { |
| 1199 | log_data_element(log_level, __FILE__, function, __LINE__, "+ ", child, 0, options|xml_log_option_diff_plus); |
| 1200 | if(is_first) { |
| 1201 | is_first = FALSE; |
| 1202 | } else { |
| 1203 | do_crm_log(log_level, " +++ "); |
| 1204 | } |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | void |
| 1209 | purge_diff_markers(xmlNode *a_node) |
no test coverage detected