Symantec logo

Agent application logging macros for C++ entry points

You can use the macro VCSAG_LOG_MSG within C++ agent entry points to log all messages ranging in severity from CRITICAL to INFORMATION to the agent log file. Use the VCSAG_CONSOLE_LOG_MSG macro to send messages to the engine log, and, in the case of messages of CRITICAL and ERROR severity, to the console.

The following table describes the argument fields for the application logging macros:

sev 

Severity of the message from the application. The values of sev are macros VCS_CRITICAL, VCS_ERROR, VCS_WARNING, VCS_NOTICE, and VCS INFORMATION; see Severity arguments for C++ macros

msgid 

The 16-bit integer message ID. 

flags 

Default flags (0) prints UMI, NEWLINE. A macro, VCS_DEFAULT_FLAGS, represents the default value for the flags. 

fmt 

A formatted string containing formatting specifiers symbols. For example: "Resource could not be brought down because the attempt to remove the file (%s) failed with error (%d)" 

variable_args 

Variable number (as many as 6) of type char, char *, or integer 

In the following example, the macros are used to log an error message to the agent log and to the console:

.

.

VCSAG_LOG_MSG(VCS_ERROR, 14002, VCS_DEFAULT_FLAGS,

"Resource could not be brought down because the

attempt to remove the file(%s) failed with error(%d)",

(CHAR *)(*attr_val), errno);

VCSAG_CONSOLE_LOG_MSG(VCS_ERROR, 14002, VCS_DEFAULT_FLAGS,

"Resource could not be brought down because, the

attempt to remove the file(%s) failed with error(%d)",

(CHAR *)(*attr_val), errno);