LOG_printf
Application Program Interface
2-191
C Interface
Syntax
LOG_printf(log, format);
or
LOG_printf(log, format,arg0);
or
LOG_printf(log, format, arg0, arg1);
Parameters
LOG_Handle log;
/* log object handle */
String
format;
/* printf format string */
Arg
arg0;
/* value for first format string token */
Arg
arg1;
/* value for second format string token */
Return Value
Void
Reentrant
yes
Description
As a convenience for C (as well as assembly language) programmers,
the LOG module provides a variation of the ever-popular printf.
LOG_printf copies a sequence number, the format address, and two
arguments to the specified log buffer.
To reduce execution time, log data is always formatted on the host. The
format string is stored on the host and accessed by the Event Log.
The arguments passed to LOG_printf must be integers, strings, or a
pointer (if the special %r or %p conversion character is used).
Casting arg0 and arg1 using the Arg type causes an erroneous value to
be printed. To print the value correctly, do not cast these parameters.
This constraint applies even though the LOG_printf function defines arg0
and arg1 as Arg type.
The format string can use any conversion character found in Table 2-4.
Table 2-4.
Conversion Characters for LOG_printf
LOG_printf
Append a formatted message to a message log
Conversion Character
Description
%d
Signed integer
%u
Unsigned integer
%x
Unsigned hexadecimal integer
%o
Unsigned octal integer