Previous  |  Next  >  
Product: Cluster Server Guides   
Manual: Cluster Server 4.1 Agent Developer's Guide   

Agent Application Logging Macros for C++ Entry Points

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

The argument fields for the application logging macros are described in the following table:

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, both 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);
 ^ Return to Top Previous  |  Next  >  
Product: Cluster Server Guides  
Manual: Cluster Server 4.1 Agent Developer's Guide  
VERITAS Software Corporation
www.veritas.com