Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 1.26 KB

how-do-i-redefine-an-fprintf-function-as-a-tracing-call-.md

File metadata and controls

29 lines (17 loc) · 1.26 KB
title description ms.date
How do I Redefine an Fprintf Function as a Tracing Call
How do I redefine an fprintf function as a tracing call
04/20/2017

How do I redefine an fprintf function as a tracing call?

An fprintf function call, which is eventually converted to an sprintf function call, is a very resource-intensive call that can degrade performance perceptibly, especially when it is used repeatedly.

Redefining an fprintf function as a tracing call is much more efficient, because the trace messages are stored in binary format and formatting is postponed until you display the trace log.

To redefine a printing function such as fprintf as a tracing call, the resulting call must do two things:

  • Assign a default level for the tracing function, such as error, warning, or noise.

  • Ignore the handle.

The following example shows a function description that does both:

-func:fprintf{LEVEL=Noise}(NULL,MSG,...)

You can define this function description in a local configuration file, such as localwpp.ini, or use the -func parameter of RUN_WPP (the macro that invokes the WPP preprocessor) to define the function description.

For a complete list of the optional parameters for RUN_WPP, see WPP Preprocessor.