HomeClusterLabs Projects

Refactor: libcrmcommon: Best practices in log_data_element()

Description

Refactor: libcrmcommon: Best practices in log_data_element()

  • Add doxygen block.
  • Use defined constants for diff prefixes. The previous assignments to prefix_m[1] made sense only if the passed-in prefix was "+ " or "- "; they don't make sense with an arbitrary prefix.
  • Replace diff prefixes with NULL in some callers. The options flags can fully determine the diff prefix within log_data_element(), in those cases.
  • Remove redundancy in check for "no children" or "diff marker".
  • Short-circuit recursive call if neither xml_log_option_diff_plus nor xml_log_option_diff_minus is set. The options flag never changes in this case, so nothing will be logged.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Dec 18 2022, 8:46 PM
Parents
rP9e2543a71f68: Refactor: libcrmcommon: Best practices for log_xml_changes()
Branches
Unknown
Tags
Unknown