Severity arguments for C++ macros

A severity argument for a logging macro, for example, VCS_ERROR or VCS_DBG1, is in fact a macro itself that expands to include the following information:

For example, the application severity argument VCS_ERROR within the monitor entry point for the FileOnOff agent would expand to include the following information:

ERROR, res_monitor, FileOnOff.C, 28

Application severity macros map to application severities defined by the enum VCSAgAppSev and the debug severity macros map to severities defined by the enum VCSAgDbgSev. For example, in the VCSAgApiDefs.h header file, these enumerated types are defined as:

enum VCSAgAppSev {

AG_CRITICAL,

AG_ERROR,

AG_WARNING,

AG_NOTICE,

AG_INFORMATION

};

enum VCSAgDbgSev {

DBG1,

DBG2,

DBG3,

.

.

DBG21,

DBG_SEV_End

};

With the severity macros, agent developers need not specify the name of the function, the file name, and the line number in each log call. The name of the function, however, must be initialized by using the macro VCSAG_LOG_INIT. See Initializing function_name using VCSAG_LOG_INIT.