摘要 |
A pre-processing script parses a message catalog of logging statements. Each record, for example, may include a distinct log message, a format string, and place-holders for variables plus a description. The script then generates a header file which defines each type of message contained in the message catalog. It then defines macros for each type of message. When a programmer writes code, he/she uses the macro format rather than the standard language format. The macros resolve upon compilation to a call to a function respective of the type and number of arguments required for the particular instance of the generic logging call. When the code is finally compiled, the compiler will generate error messages when the number and type of arguments do not match.
|