DUECA/DUSIME
Loading...
Searching...
No Matches
Macros
debug.h File Reference

Here macros for debugging/messaging are defined. More...

Include dependency graph for debug.h:
This graph shows which files directly or indirectly include this file:

Macros

#define NEW_LOGGING
 If defined, using the new logging scheme, with Logger objects and a LogConcentrator.
 
#define SOURCE_PATH_SIZE   0
 Default value for source path trimming, needed for clean error messages that do not show build location.
 

Detailed Description

Here macros for debugging/messaging are defined.

The macros consist of a one-letter prefix indicating the logging level, and a three letter suffix indicating the logging class, e.g., D_MOD, for logging debug messages for user modules.

Four different classes of debug messages are defined:

  1. Simple debugging messages, macros prefixed with D_ . If you throw this in, then in general a lot of garbage is generated.
  2. Informational messages, macros prefixed with I_ . These are for "important" messages, not general "every cycle" messages.
  3. Warning messages, macros prefixed with W_ . These are for minor errors, on which the system will try to continue, but functionality may be affected.
  4. Error messages, macros prefixed with E_ . Serious stuff, if you have a safety-critical system, you should safely stop. It may also be that there is an abrupt stop of the system.

By default, logging with the D_ and I_ macros is switched off, logging with the W_ and E_ prefixes is switched on. The logging interface accessible from the DUECA application window can be used to adjust the different logging levels at runtime.

Before including this file, you can pre-define the macros, to influence the defaults, like:

#define D_MOD
#define I_MOD
#include <dueca/debug.h>
Here macros for debugging/messaging are defined.

This will have the initial debug and information messages in this file be on. During development, this might be preferable to switching all logging with the interface.

If using this in a header, include the file undebug.h at the end of the header to clear the macros again.