HomeClusterLabs Projects

Refactor: libcrmcommon: Formatted output in pcmk__xml_log()

Description

Refactor: libcrmcommon: Formatted output in pcmk__xml_log()

Rename to pcmkxml_show() to reflect that this function is more
generally for output rather than for logging. pcmk
xml_output() is
better but too easily confused with existing output functions.

Rename helper functions to use "show" as well.

This approach, in which pcmk__xml_show() accepts a NULL output object
and creates a new one based on log level if NULL, is only temporary.
It allows us to make this change in isolation, without having to modify
anything in the callers except the calls themselves. Later commits will
improve this.

Note that there are no message formatter functions for XML comments and
elements. There is currently no need for this functionality for XML or
other non-text-like formats -- it's used only with text and log -- so
it's much simpler to have regular static helper functions that call
out->info() indiscriminately. If we need to support other output formats
later, we can add message functions.

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

Details

Provenance
nrwahl2Authored on Dec 27 2022, 3:11 PM
Parents
rPe2ad20affc7b: Refactor: libcrmcommon: Re-macroize do_crm_log_xml()
Branches
Unknown
Tags
Unknown