OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
The following call in hello_svc.c would have written this message to standard error
(because that is the routing specified in the sams file), provided that debug level 3
had been activated:
DCE_SVC_LOG((HEL_S_DEBUG_MESSAGE_1_MSG));
Note the use of the double parentheses. This is made necessary by the fact that it is a
macro that takes a variable number of arguments. Note alse the use of the
convenience macro form of the message. A full form of the call, with all arguments
explicitly specified, would have been as follows:
DCE_SVC_LOG((DCE_SVC(hel_svc_handle, ""), \
hel_s_main, svc_c_debug3, hel_s_debug_message_1));
/* | | | */
/* table_index | | */
/* debug level | */
/* message ID */
Debug messages, like normal serviceability messages, can also contain format
specifiers and argument lists.
• DCE_SVC_DEBUG( )
Outputs a message whose text is specified in the call. For example, the following call
could have appeared in hello_svc.c:
DCE_SVC_DEBUG((hel_svc_handle, \
/* | */
/* handle */
/* */
hel_s_main, svc_c_debug2, "A Debug Level %d message", 2));
/* | | | | */
/* table_index | | | */
/* debug level | | */
/* message text | */
/* argument */
Note here too the use of the double parentheses.
Note also that DCE_SVC_DEBUG cannot be used with the convenience macro
forms of serviceability messages.
• DCE_SVC_DEBUG_ATLEAST( )
Tests the active debug level for a subcomponent. Returns TRUE if the debug level
(set by calling dce_svc_debug_set_levels(); see Section 4.3.12.1) is not less than the
specified level; otherwise returns FALSE. For example, the following call would
return TRUE if the debug level for the hel_s_main subcomponent of the hello_svc
application had been set to svc_c_debug2 or any higher value:
DCE_SVC_DEBUG_ATLEAST(hel_svc_handle, hel_s_main, svc_c_debug2);
4− 34 Tandem Computers Incorporated 124245