27 #include "timestamp.h"
31 void debugOut(
const string &message);
73 mDebugLevel = debugLevel;
75 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
79 out<<bufferTime(amb::currentTime())<<
" | ";
81 if(mDebugLevel == Error)
83 if(mDebugLevel == Warning)
87 DebugOut const& operator << (
const string &message)
const
89 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
98 DebugOut const& operator << (ostream & (*manip)(std::ostream&))
const
102 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
108 if((mDebugLevel == Error && throwErr))
110 throw std::runtime_error(
"Abort on Error is set");
112 else if ((mDebugLevel == Warning && throwWarn))
114 throw std::runtime_error(
"Abort on Warning is set");
120 DebugOut const & operator << (
double val)
const
122 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
131 static void setDebugThreshhold(
int th)
133 debugThreshhold = th;
136 static void setOutput(ostream &o)
141 static void setThrowWarn(
bool v)
146 static void setThrowErr(
bool v)
151 static const int getDebugThreshhold()
153 return debugThreshhold;
158 std::string bufferTime(
double time)
166 while(f.str().length() <= 15)
174 static int debugThreshhold;
175 static std::streambuf *buf;
176 static bool throwWarn;
177 static bool throwErr;
static const int Error
Error use when essential functionality is blocked.
Definition: debugout.h:64
static const int Warning
Warning use when non-essential functionality is bocked, or when workarounds exist.
Definition: debugout.h:69
The DebugOut class represents a class used for outputing debug information The specified debug level ...
Definition: debugout.h:57