HomeClusterLabs Projects

Refactor: libcrmcommon: allow setting filters for logger output objects

Description

Refactor: libcrmcommon: allow setting filters for logger output objects

With the usual logging functions, filters (PCMK_trace_functions etc.) operate
based on the caller's file, function, and line number. However, with logger
output objects, there was previously no way to set those, so the logger method
implementation itself would always be used for filtering.

A new internal API pcmk__output_set_log_filter() allows setting the file,
function, line number, and tags that will be used to filter logger
output object messages.

libqb logging functions are called directly to accomplish this, which as a
side effect allows us to use variadic arguments directly rather than allocate a
separate buffer in some cases.

As of this commit, nothing uses the new API yet.

Details

Provenance
kgaillotAuthored on Jul 13 2023, 5:18 PM
Parents
rP46d1f9f194b5: Merge pull request #3160 from kgaillot/actions
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task