HomeClusterLabs Projects

Refactor: all: define and implement LOG_STDOUT and LOG_NEVER severities

Description

Refactor: all: define and implement LOG_STDOUT and LOG_NEVER severities

The literal constant 0, along with -1 in tools/iso8601.c, was previously used
to indicate (to a handful of logging functions and macros) that the message
should be printed to stdout rather than logged.

0 is a poor choice because it is equal to LOG_EMERG, and -1 is a poor choice
because many libqb logging functions use uint8_t for log priorities.

Instead, define LOG_STDOUT (as 254) for this purpose. Also enable it for
do_crm_log(), allowing some calling code to be simplified.

In addition, define and implement LOG_NEVER (as 255) to indicate that the
message should not be logged or printed at all. This will be useful when using
a variable log level, or log level function argument, when logging is sometimes
desired and sometimes not.

Details

Provenance
kgaillotAuthored on Nov 21 2019, 5:50 PM
Parents
rP9f7d8970095d: Doc: libpacemaker: comment spelling
Branches
Unknown
Tags
Unknown

Event Timeline