NAME

CAT_IFDBG - test debug level and label

SYNOPSIS

#include <cat/cat.h>

CAT_IFDBG(int level, const char *label);

DESCRIPTION

The CAT_IFDBG() macro tests whether debug tracing has been activated for the specified label at given debug level.

If compiling with -DCAT_NODEBUG, this macro will always evaluate to FALSE.

EXAMPLE

The macro can be used to avoid time-consuming operations when debug tracing is disabled:

  if (CAT_IFDBG(3, "mymodule.thisfunction")) {
      /*
       * Do some calculations and formatting, and output
       * the result with CAT_DEBUG3()
       */
  }
  /* Resume normal operation */

SEE ALSO

cat, caterr, caterr_error, CAT_DEBUGn