HomeClusterLabs Projects

Refactor: various: Use pcmk__output_t in pcmk__xml_log_changes()

Description

Refactor: various: Use pcmkoutput_t in pcmkxml_log_changes()

And rename it to pcmk__xml_show_changes().

pcmkxml_show_changes() had already been updated to create a
pcmk
output_t object that eventually gets passed to pcmkxml_show().
This commit allows us to reuse an existing pcmk
output_t object
(currently only done in based_callbacks.c:process_ping_reply()).

An alternative would be to allow pcmkxml_show_changes() to accept a
pcmk
output_t argument and a log_level argument: if the output argument
is NULL, create a new temporary one based on the level argument. That
would simplify most of the callers at the expense of muddying the
interface and implementation of pcmk__xml_show_changes().

Note that there's no current need to use pcmk__xml_show_changes() with
any output format other than text and log, so we just use out->info().
Formatting the output for XML would be awkward, so I'd rather cross that
bridge if and when we come to it.

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

Details

Provenance
nrwahl2Authored on Jan 30 2023, 4:41 AM
Parents
rPa59e94a43b70: Refactor: libcrmcommon: Remove unused log_level arg of pcmk__xml_show()
Branches
Unknown
Tags
Unknown