cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Typedefs | Functions
cmnLogLoD.h File Reference

Declaration of Levels of Detail for cmnLogger (human readable logging) More...

#include <cisstCommon/cmnPortability.h>
#include <cisstCommon/cmnExport.h>

Go to the source code of this file.

Macros

#define _cmnLogLoD_h
 
#define CMN_LOG_LEVEL_NONE   0x00
 
#define CMN_LOG_LEVEL_INIT_ERROR   0x01
 
#define CMN_LOG_LEVEL_INIT_WARNING   0x02
 
#define CMN_LOG_LEVEL_INIT_VERBOSE   0x04
 
#define CMN_LOG_LEVEL_INIT_DEBUG   0x08
 
#define CMN_LOG_LEVEL_RUN_ERROR   0x10
 
#define CMN_LOG_LEVEL_RUN_WARNING   0x20
 
#define CMN_LOG_LEVEL_RUN_VERBOSE   0x40
 
#define CMN_LOG_LEVEL_RUN_DEBUG   0x80
 
#define CMN_LOG_ALLOW_NONE   0x00
 
#define CMN_LOG_ALLOW_ERRORS   0x11
 
#define CMN_LOG_ALLOW_WARNINGS   0x22
 
#define CMN_LOG_ALLOW_ERRORS_AND_WARNINGS   0x33
 
#define CMN_LOG_ALLOW_VERBOSE   0x77
 
#define CMN_LOG_ALLOW_DEBUG   0xFF
 
#define CMN_LOG_ALLOW_ALL   0xFF
 
#define CMN_LOG_ALLOW_DEFAULT   CMN_LOG_ALLOW_ERRORS_AND_WARNINGS
 
#define CMN_LOG_LOD_NONE   0x00
 
#define CMN_LOG_LOD_INIT_ERROR   0x01
 
#define CMN_LOG_LOD_INIT_WARNING   0x03
 
#define CMN_LOG_LOD_INIT_VERBOSE   0x07
 
#define CMN_LOG_LOD_INIT_DEBUG   0x0F
 
#define CMN_LOG_LOD_RUN_ERROR   0x1F
 
#define CMN_LOG_LOD_RUN_WARNING   0x3F
 
#define CMN_LOG_LOD_RUN_VERBOSE   0x7F
 
#define CMN_LOG_LOD_RUN_DEBUG   0xFF
 
#define CMN_LOG_LOD_VERY_VERBOSE   CMN_LOG_LOD_RUN_DEBUG
 
#define CMN_LOG_DEFAULT_LOD   CMN_LOG_ALLOW_ERRORS_AND_WARNINGS
 

Typedefs

typedef short cmnLogLevel
 
typedef short cmnLogMask
 

Functions

CISST_EXPORT size_t cmnLogLevelToIndex (const cmnLogLevel &level)
 
CISST_EXPORT cmnLogLevel cmnIndexToLogLevel (const size_t &index)
 
CISST_EXPORT const std::string & cmnLogIndexToString (const size_t &index)
 
CISST_EXPORT const std::string & cmnLogLevelToString (const cmnLogLevel &level)
 
CISST_EXPORT std::string cmnLogMaskToString (const cmnLogMask &mask)
 

Detailed Description

Declaration of Levels of Detail for cmnLogger (human readable logging)

Macro Definition Documentation

#define _cmnLogLoD_h
#define CMN_LOG_ALLOW_ALL   0xFF
#define CMN_LOG_ALLOW_DEBUG   0xFF
#define CMN_LOG_ALLOW_DEFAULT   CMN_LOG_ALLOW_ERRORS_AND_WARNINGS
#define CMN_LOG_ALLOW_ERRORS   0x11
#define CMN_LOG_ALLOW_ERRORS_AND_WARNINGS   0x33
#define CMN_LOG_ALLOW_NONE   0x00
#define CMN_LOG_ALLOW_VERBOSE   0x77
#define CMN_LOG_ALLOW_WARNINGS   0x22
#define CMN_LOG_DEFAULT_LOD   CMN_LOG_ALLOW_ERRORS_AND_WARNINGS
#define CMN_LOG_LEVEL_INIT_DEBUG   0x08
#define CMN_LOG_LEVEL_INIT_ERROR   0x01
#define CMN_LOG_LEVEL_INIT_VERBOSE   0x04
#define CMN_LOG_LEVEL_INIT_WARNING   0x02
#define CMN_LOG_LEVEL_NONE   0x00
#define CMN_LOG_LEVEL_RUN_DEBUG   0x80
#define CMN_LOG_LEVEL_RUN_ERROR   0x10
#define CMN_LOG_LEVEL_RUN_VERBOSE   0x40
#define CMN_LOG_LEVEL_RUN_WARNING   0x20
#define CMN_LOG_LOD_INIT_DEBUG   0x0F
#define CMN_LOG_LOD_INIT_ERROR   0x01
#define CMN_LOG_LOD_INIT_VERBOSE   0x07
#define CMN_LOG_LOD_INIT_WARNING   0x03
#define CMN_LOG_LOD_NONE   0x00

Values used to represent the different level of details associated to messages and filters used in cmnLogger. The higher the value the less important the message is. Lower values are used for the initialization phase (i.e. constructor, configuration, ...) while the higher values are used for normal operations.

These are provided for backward compatibility.

#define CMN_LOG_LOD_RUN_DEBUG   0xFF
#define CMN_LOG_LOD_RUN_ERROR   0x1F
#define CMN_LOG_LOD_RUN_VERBOSE   0x7F
#define CMN_LOG_LOD_RUN_WARNING   0x3F
#define CMN_LOG_LOD_VERY_VERBOSE   CMN_LOG_LOD_RUN_DEBUG

Typedef Documentation

typedef short cmnLogLevel

Type used for all messages to indicate the level (nature) of the message. Each level uses one bit out of 8. There is an implicit order between the levels i.e. they are sorted as follow:

Init

Error

Warning

Verbose (aka message)

Debug

Run

Error

Warning

Verbose (aka message)

Debug

Messages will be logged or not based on the different filters used. Each filter uses the type cmnLogMask.

typedef short cmnLogMask

Function Documentation

CISST_EXPORT cmnLogLevel cmnIndexToLogLevel ( const size_t &  index)

Convert an index to a level of detail. This can be used for a program that needs to list all possible levels of detail

CISST_EXPORT const std::string& cmnLogIndexToString ( const size_t &  index)

Provide a human readable string (e.g. "Error (init)") for a given index (index correpond to the position of a single bit in a log mask).

CISST_EXPORT size_t cmnLogLevelToIndex ( const cmnLogLevel level)

Convert a log level to an index. The index value will be between 0 and 8 (included). This can be used to list all possible levels of detail associated to a message.

CISST_EXPORT const std::string& cmnLogLevelToString ( const cmnLogLevel level)

Provide a human readable string for a log level. This is used in all log output to indicate the message level (Error, Warning, Message, Debug during initialization or run).

CISST_EXPORT std::string cmnLogMaskToString ( const cmnLogMask mask)

Provide a human readable list of all message levels the mask will allow.