/*! \file \brief Class creaMessageManager and Macros for outputing messages in crea There are 4 kinds of messages : - Messages (normal messages) - Debug messages (not compiled in release) - Warnings - Errors There are also "types" of messages which are strings which identify the nature of the message (for example : "Kernel" messages are generated by the core classes of the library, there can be a type of message for each type of Node, and so on...) A type of message must be declared by registering it into the MessageManager. This is done by a line like : crea::MessageManager::RegisterMessageType("Kernel","Messages generated by the core classes of the library",5); where : -The first string is the type of the message (the category which will be used to generate a message of this type) -The second string is help string -The integer is the initial level for the messages of this type (see below). To generate a message of a known type then use one of the macros : creaMessage, creaDebugMessage, creaWarning, creaError or their variants. example : creaMessage("Kernel",4,"problem with "< #include #include #include // Comment out these symbols to prevent compilation //#define CREA_COMPILE_MESSAGES //#define CREA_COMPILE_DEBUG_MESSAGES //#define CREA_COMPILE_WARNING_MESSAGES //#define CREA_COMPILE_ERROR_MESSAGES #define creaOnMessageLevel(key,value) \ int __creaOnMessageLevelVariable = \ crea::MessageManager::GetMessageLevel(key); \ if ( __creaOnMessageLevelVariable<0) \ { \ creaWarning("message type '"<0) \ { \ std::cerr << "!! WARNING !! " << MESSAGE << std::endl; \ if (lev >1) \ { \ std::cerr << "!! WARNING !! In file '"<<__FILE__ \ <<"' ; Line "<<__LINE__< mMessageLevel; std::map mMessageHelp; unsigned int mMaxMessageLength; }; //=========================================================== } #include "creaException.h" #endif