DUECA/DUSIME
Log message generation and control

An overview of the facilities for creating log messages.

Logging macros, logging classes

In order to display and record log messages on significant events in DUECA programs, a set of log macros is defined. To the programmer, these macros present an easy way of printing a message; by simply following the conventions for printing in C++. These messages are both printed on the standard error output of a DUECA program, but they are also sent, collected and recorded centrally within the DUECA process. Each message is also coded with file name and line within the file, so that a programmer can quickly find where the message was generated.

The following logging classes are defined:

In addition, a number of categories are defined. The normal category used by application programmers is MOD, indicating messages from a DUECA module. DUECA itself distinguishes the following:

A log command would look like a normal function call, as an example, here a message from the ChannelReplicator in the dueca-inter library:

/* DUECA interconnect.
There is a difference in definition of a DCO data class
between the current node and a remote node. Fix the code,
probably by running an update and recompile, ensure the DCO
definitions are identical. */
E_INT("data class magic for " << *ci << " differs with node " << node);

Switching logging on and off

Logging macros are accessible by including DUECA's debug.h header:

#include <debug.h>

By default, warning and error level messages are switched on, but debug and information level messages are suppressed. This means that the code to generate the message is inserted in a DUECA program, but by default "hitting" a logpoint will not generate a message. When developing, it is often useful to have more log information. You can select the default state of logging by providing C defines for the logging macros, which will be replaced by the debug.h header, for example:

#define D_MOD
#define I_MOD
#include <debug.h>

Now the D_MOD and I_MOD macros are defined to produce logging (as before), but they will by default be "active" for this source file, i.e., produce logging messages rather than be silent. Using the logging interface (see next section), the logging levels of the different log categories can be overridden during runtime.

Logging output.

The log output is available in a number of different places:

Here is a list of all log messages in DUECA's libraries.