ITLogLevel enum and its connection to the loglevel of a logmessage

This enumeration type is used to define the level (or importance) of a logmessage, which we call the Loglevel. The Loglevel is displayed in the ITLogBook application and can be used there to filter logmessages.

 

In fact, the Loglevel of a logmessage is a combination of independent bits, and the enumeration type ITLogLevel doesn’t represent the Loglevel type, but defines the symbolical constants for these bits.

Here is the definition of the ITLogLevel type:

 

typedef enum {

LEVEL_INFO = 1,

LEVEL_WARNING = 2,

LEVEL_ERROR = 4,

LEVEL_ALARM = 8

} ITLogLevel;

 

The actual Loglevel value of a logmessage -- in which more than one bit can be set -- is currently represented using type short in the ITLogLib API (see method ITLogMsg::GetLogLevel).

 

You can modify the Loglevel of a logmessage using the following methods ITLogMsg::SetLogLevel() and ITLogMsg::AddLogLevel(). Both formally accept only an ITLogLevel enumeration value (a single bit). If you want to set a combination of bits you can:

§      use a combination of ITLogLevel values as parameter of SetLogLevel() or AddLogLevel() (must be cast back to ITLogLevel -- not very nice, but working)

§      use several calls to AddLogLevel -- each for one bit you want to set