27 #include "timestamp.h" 31 void debugOut(
const string &message);
70 void deprecateMethod(
const string &methodName,
const std::string & version);
89 mDebugLevel = debugLevel;
91 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
95 out<<bufferTime(amb::currentTime())<<
" | ";
97 if(mDebugLevel == Error)
99 if(mDebugLevel == Warning)
103 DebugOut const& operator << (
const string &message)
const 105 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
114 DebugOut const& operator << (ostream & (*manip)(std::ostream&))
const 118 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
124 if((mDebugLevel == Error && throwErr))
126 throw std::runtime_error(
"Abort on Error is set");
128 else if ((mDebugLevel == Warning && throwWarn))
130 throw std::runtime_error(
"Abort on Warning is set");
136 DebugOut const & operator << (
double val)
const 138 if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
147 static void setDebugThreshhold(
int th)
149 debugThreshhold = th;
152 static void setOutput(ostream &o)
157 static void setThrowWarn(
bool v)
162 static void setThrowErr(
bool v)
167 static const int getDebugThreshhold()
169 return debugThreshhold;
174 std::string bufferTime(
double time)
182 while(f.str().length() <= 15)
190 static int debugThreshhold;
191 static std::streambuf *buf;
192 static bool throwWarn;
193 static bool throwErr;
Definition: picojson.h:1002
static const int Error
Error use when essential functionality is blocked.
Definition: debugout.h:80
static const int Warning
Warning use when non-essential functionality is bocked, or when workarounds exist.
Definition: debugout.h:85
Definition: abstractpropertytype.h:256
void deprecateMethod(const string &methodName, const std::string &version)
deprecateMethod prints warning if method is used. Throws if version >= PROJECT_SERIES ...
Definition: debugout.h:73