OSF DCE Application Development Guide--Core Components

Using the DCE Serviceability Application Interface
1994-04-05-20:13:34.500+00:00I----- PID#9467 NOTICE hel main hello_svc.c line_nr 0xa444e208
Hello World
In this example, the first line is the message prolog, and the second line is the message
text. If the message were generated with the SVC_BRIEF environment variable set to 1,
the message would appear as follows:
Hello World
Prologs of separate messages can be suppressed selectively through the use of the
svc_c_action_brief attribute; see the previous section.
4.3.9 Serviceability Use of the __FILE__ Macro
Whenever a serviceability message is generated, information identifying the source file
and line at which the invoked routine was called is included in the message information.
This information appears in the text-form nonerror messages, and it is also written into
the binary form serviceability logs (when binary logs are specified). The information
also appears in the text form of messages announcing error situations. For example:
1994-07-20-11:11:09.906-04:00I----- sample_server FATAL smp server \
sample_server.c 2851 0xa44b0c18
server_renew_identity(): login context has not been certified (dce / sec)
(The preprocessor variable DCE_SVC_WANT__FILE__ (in dce/dce_svc.h) will be
defined or undefined depending on whether or not the serviceability component has been
set up on your system to include the filename and line number information in
serviceability messages.)
The serviceability routines receive the source le information from
DCE_SVC__FILE__, which, by default, is defined to be the C preprocessor macro
__FILE__. However, if you desire to avoid these macro expansions in your application
code, you can redefine the symbol to be some kind of variable. For example:
#define DCE_SVC__FILE__ myfile
#include <dce/dce.h>
static char myfile[] = __FILE__;
4.3.10 Forcing Use of the In-Memory Message Table
As described elsewhere in this chapter, the dce_msg_define_msg_table( ) routine can be
called by an application to initialize an in-memory copy of its message table, thus freeing
the application from depending on its message catalog’s being properly installed for its
serviceability messages to be properly generated.
124245 Tandem Computers Incorporated 4 29