QH_LOG_CHECK()

Updated: May 06, 2022

A macro that checks whether a message with the specified severity would be logged

Synopsis:

#include <qh/log.h>
#define QH_LOG_CHECK(severity)

Arguments:

severity
The QH_LOG_SEVERITY_* severity level for this log message. Optionally, can be combined with QH_LOG_DEST_*, QH_LOG_NO_DEST_*, or both when specific messages also need to add or block destinations.

Library:

qh

Description:

Given a message's severity, this function determines if it is logged when it is used in a logging call. It is simpler to use than qh_log_check() because it only requires a severity parameter. This function is useful when a message is expensive to build because the caller can determine whether to build a message based on whether it would be logged.

Returns:

true if the message would be logged, and false otherwise.