NAME

catgen_initdebug - initialize debug tracing

SYNOPSIS

#include <cat/gen.h>

int catgen_initdebug(const char *spec);

DESCRIPTION

This function initializes debugging by setting the debug specification. See caterr_setdebug for a description of the debug specification format.

The debug specification is defined by the spec parameter, which can be NULL.

The debug specification can be set in a number of ways, that is, using the spec parameter, via the command line, or in the configuration data. This function uses the following search order to set the debug specification:

The spec argument
If the spec argument to this function is non-NULL, it will be used as the debug specification.

Already set (for example, from the command line)
If a debug specification is already set, it will be used.

.gen.override.debug
The branch of the info tree with the highest precedence.

.services.service.debug
The service-specific (for each Agent) branch of the info tree.

.global.debug
The global branch of the info tree.

If the debug specification is not explicit (that is, it is not supplied as argument to this function and is not already set) the parameter ``debug.file'' will be used as the debug output file. The function searches for this in the same info tree branches as the debug specification.

RETURN VALUES

The function returns 0 if successful, or a negative code on error.

SEE ALSO

cat, catgen

caterr_setdebug, catgen_err, catgen_warn