Header file for (super)class MURE; also definitions for debugging message macros. More...
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <libmctal/TMctal.hxx>
#include <libmctal/TMTally.hxx>
#include "MureHeaders.hxx"
Go to the source code of this file.
Classes | |
class | MURE |
MURE class allow to make connections between classes. More... | |
Macros | |
#define | LOG_LEVEL_DEBUG 0 |
#define | LOG_LEVEL_WARNING 2 |
Importance level of warning message. More... | |
#define | LOG_LEVEL_IMPORTANT_WARNING 3 |
Importance level of warning message. More... | |
#define | LOG_LEVEL_ALERT 4 |
Importance level of alert message. More... | |
#define | LOG_LEVEL_ERROR 5 |
Importance level of error message. More... | |
#define | __METHOD_NAME__ __macro_method_name__(__PRETTY_FUNCTION__) |
#define | LOG_DEBUG(msg) {if ((!NODEBUG)&&((DODEBUG)||(!gMURE->GetSilentDebug()))&&(gMURE->GetMessageLevel()<=LOG_LEVEL_DEBUG)) cout<<__METHOD_NAME__<<" : "<<msg<<endl;} |
#define | LOG_INFO(msg) { cout<<msg<<endl;} |
Print info message (Now MURE is doing this ...) More... | |
#define | LOG_WARN(msg) {if ((!gMURE->GetSilentDebug())&&(gMURE->GetMessageLevel()<=LOG_LEVEL_WARNING)) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;}} |
Print a warning (something happened, but MURE took care) More... | |
#define | LOG_IMP_WARN(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_IMPORTANT_WARNING) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<left<<setw(75)<<setfill('*')<<"*"<<endl;}} |
Print a important warning (something happened, but MURE took care) More... | |
#define | LOG_ALERT(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ALERT) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('!')<<("!!!! ALERT in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"!"<<endl;}} |
Print an alert (something is wrong and the result won't probably be OK) More... | |
#define | LOG_ERROR(msg) {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ERROR) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('=')<<("==== ERROR in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"= Exiting MURE ="<<endl;}exit(0);} |
Print an error and terminate the program by calling exit(0). More... | |
Variables | |
const int | NODEBUG =0 |
const int | DODEBUG =0 |
Header file for (super)class MURE; also definitions for debugging message macros.
#define __METHOD_NAME__ __macro_method_name__(__PRETTY_FUNCTION__) |
Macros for printing messages. They check for level and do the printing. Macros are better than functions, because it is possible to treat the parameter as a stream, e.g. LOG_WARN("Value is "<<i);
#define LOG_ALERT | ( | msg | ) | {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ALERT) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('!')<<("!!!! ALERT in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"!"<<endl;}} |
Print an alert (something is wrong and the result won't probably be OK)
#define LOG_DEBUG | ( | msg | ) | {if ((!NODEBUG)&&((DODEBUG)||(!gMURE->GetSilentDebug()))&&(gMURE->GetMessageLevel()<=LOG_LEVEL_DEBUG)) cout<<__METHOD_NAME__<<" : "<<msg<<endl;} |
Print a debug message. It is possible to suppress debug msg printing in single procedure (or program block) by hiding global variable NODEBUG: int NODEBUG=1;
#define LOG_ERROR | ( | msg | ) | {if (gMURE->GetMessageLevel()<=LOG_LEVEL_ERROR) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('=')<<("==== ERROR in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<setw(75)<<setfill('=')<<"= Exiting MURE ="<<endl;}exit(0);} |
Print an error and terminate the program by calling exit(0).
#define LOG_IMP_WARN | ( | msg | ) | {if (gMURE->GetMessageLevel()<=LOG_LEVEL_IMPORTANT_WARNING) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;cout<<left<<setw(75)<<setfill('*')<<"*"<<endl;}} |
Print a important warning (something happened, but MURE took care)
#define LOG_INFO | ( | msg | ) | { cout<<msg<<endl;} |
Print info message (Now MURE is doing this ...)
#define LOG_LEVEL_ALERT 4 |
Importance level of alert message.
#define LOG_LEVEL_DEBUG 0 |
These are constants for importance levels of messages Importance level of debug message
#define LOG_LEVEL_ERROR 5 |
Importance level of error message.
#define LOG_LEVEL_IMPORTANT_WARNING 3 |
Importance level of warning message.
#define LOG_LEVEL_WARNING 2 |
Importance level of warning message.
#define LOG_WARN | ( | msg | ) | {if ((!gMURE->GetSilentDebug())&&(gMURE->GetMessageLevel()<=LOG_LEVEL_WARNING)) {ostringstream s;s<<msg;cout<<left<<setw(75)<<setfill('*')<<("**** WARNING in "+__METHOD_NAME__+" ")<<endl;cout<<wordwrap(s.str(),75)<<endl;}} |
Print a warning (something happened, but MURE took care)
const int DODEBUG =0 |
const int NODEBUG =0 |