Initializing function_name using VCSAG_LOG_INIT

One requirement for logging of messages included in C++ functions is to initialize the function_name variable within each function. The macro, VCSAG_LOG_INIT, defines a local constant character string to store the function name:

VCSAG_LOG_INIT(func_name) const char *_function_name_ = func_name

For example, the function named "res_offline" would contain:

void res_offline (int a, char *b)

{

VCSAG_LOG_INIT("res_offline");

.

.

}

Note   If the function name is not initialized with the VCSAG_LOG_INIT macro, when the agent is compiled, errors indicate that the name of the function is not defined.

See the Examples of logging APIs used in a C++ agent for more examples of the VCSAG_LOG_INIT macro.