The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches

Description

Macros for debugging and tracing C++ programs.

DEBUGLOG, TRACELOG: general macros for debugging. They require having
             defined previously the macro DEBUG to an int value
             (1-> no pauses after each log; 2-> pause after each log),
             or to have it undefined if we do not require debugging.

These macros define two modalities of debugging/tracing:

NOTE:

-Traces also require to define the DEBUG constant

-Include this file after defining (or undefining) the DEBUG const
and OUTSIDE any namespace.

http://jafma.net

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Collaboration diagram for Debugging:

Debug macros

There are two cases:

  • DEBUG is defined (before including this file). In that case, either DEBUG == 2 or not (typically, DEBUG == 1). In the former case a pause will be done by requesting an integer from console after each DEBUG(txt). In any case, defining DEBUG enables the use of the transient debugging macro, TRACE(txt). For transient, method-scope debugs, define at the beginning of the method a TRACE(txt) equal to TRACELOG(txt) and undefine it at the end of the method. Then use TRACE(txt) for the transient debug logs in the method. If you need finer traces (e.g., containing code), define your own macro in the routine and undefine it later, e.g., FINETRACE.
  • DEBUG is not defined. In that case all these macros are defined to empty in order not to generate any code.
#define DEBUGLOG(txt)
 
#define TRACELOG(txt)
 

Macro Definition Documentation

◆ DEBUGLOG

#define DEBUGLOG (   txt)

#include <Debugging.h>

Definition at line 106 of file Debugging.h.

◆ TRACELOG

#define TRACELOG (   txt)

#include <Debugging.h>

Definition at line 108 of file Debugging.h.