OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
TRACE and WARN Example

The following program illustrates the use of the default TRACE and WARN macros:

#include <checks.h>
int main()
{
TRACE( "Hello World" );
WARN( 5 != 5, "Math is broken!"
);
WARN( 5 != 7, "Math still works!"
);
return 0;
}
Diagnostic macros for assertions and tracing.
#define TRACE(message)
Definition checks.h:255
#define WARN(condition, message)
Definition checks.h:273

When the above code is compiled with _ _TRACE and _ _WARN defined, it produces the following output when run:

Trace PROG.C 5: [Def] Hello World

The above output indicates that the message "Hello World" was output by the default TRACE macro on line 5 of PROG.C, and the message "Math still works!" was output by the default WARN macro on line 7 of PROG.C. Default diagnostic macros expand to extended diagnostic macros with the group set to "Def" and the level set to 0. This "Def" group controls the behavior of the default macros and is initially enabled with a threshold level of 0.