OSF DCE Application Development Guide--Core Components

Using the DCE Serviceability Application Interface
/*****
* install_filters-- calls dce_svc_define_filter() to install
* the above 2 routines. Note that this must
* be done after dce_svc_register() is
* called, not before.
*****/
void install_filters()
{
unsigned32 status;
dce_svc_define_filter(hel_svc_handle, hel_filter, \
hel_filter_control, &status);
}
4.3.12 UsingServiceability for Debug Messages
Apart from the dce_svc_printf( ) routine for writing production serviceability messages,
the interface provides several macros that can be used for debug messaging in a server.
The advantages in using these macros in debugging are the following:
All of the debug messaging code can easily be compiled in or out of the executable
by changing the value of a compilation switch.
Nine levels of debug messaging are provided for; the active level of debug messaging
can be controlled through the remote serviceability interface or by a value passed to
the server at startup.
One of the macros allows message text to be specified in the call itself, rather than
extracting it by message ID from the message table.
The debug serviceability messaging routines are the following:
DCE_SVC_LOG( )
Outputs a message specified by the message ID. The main difference between using
this routine and using dce_svc_printf( ) to write a message is that the macro can be
compiled out of the executable by turning off debugging.
Suppose the following message had been defined in the hel.sams file for the example
application at the beginning of this chapter:
start
code hel_s_debug_message_1
subcomponent hel_s_main
attributes "svc_c_debug3 | svc_c_route_stderr"
text "This is a level 1 test debug message"
explanation "Debug level 3 test"
action "None required."
end
124245 Tandem Computers Incorporated 4 33