OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
• If DCE_SVC_DEBUG() or DCE_SVC_LOG() is used to print the message, the
debug level is specified in the call.
The debug level can be set by calling dce_svc_debug_set_levels( ) and passing to it a
specially formatted string (the debug level is also set when debug routing is specified;
see the next section for further information). Levels can be separately specified for
subcomponents. For example, suppose two subcomponents (rather than one) had been
defined in the sams file for the hello_svc application at the beginning of this chapter, as
follows:
# Part II
serviceability table hel_svc_table handle hel_svc_handle
start
subcomponent hel_s_main "main" hel_i_svc_main
subcomponent hel_s_utils "utils" hel_i_svc_utils
end
The following string would, when passed to dce_svc_debug_set_levels(), set the debug
level for the main subcomponent to be svc_c_debug1, and the debug level for the utils
subcomponent to be svc_c_debug4:
unsigned_char_t *levels = "hel:main.1,utils.4";
The general format for the debug level specifier string is as follows:
component:sub_comp.level,sub_comp.level,. . .
where:
component Is the three-character component code for the program.
sub_comp.level Is a subcomponent name, followed (after a dot) by a debug level
(expressed as a single digit from 1 to 9). Note that multiple
subcomponent/level pairs can be specified in the string.
If there are multiple subcomponents, and it is desired to set the debug level to be the
same for all of them, then the following form will do this (where the * (asterisk) specifies
all subcomponents).
component:*.level
The string can be passed to dce_svc_debug_set_levels( ) as follows:
dce_svc_debug_set_levels(levels, &status);
where levels is a string declared similarly to the example shown earlier in this section.
The nine serviceability debug message level specifiers are as follows:
• svc_c_debug1
• svc_c_debug2
• svc_c_debug3
4− 36 Tandem Computers Incorporated 124245