int DebugOut::debugThreshhold = 0;
std::streambuf * DebugOut::buf = cout.rdbuf();
+const int DebugOut::Error = 9999999999;
+const int DebugOut::Warning = 9999999998;
+
void debugOut(string message)
{
- cout<<"DEBUG: "<<message<<endl;
+ DebugOut()<<"DEBUG: "<<message<<endl;
}
class DebugOut
{
-public:
+public:
+
+ static const int Error;
+ static const int Warning;
+
DebugOut(int debugLevel = 4)
{
mDebugLevel = debugLevel;
out.precision(15);
- if(mDebugLevel <= debugThreshhold)
+ if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
+ {
out<<bufferTime(amb::currentTime())<<" | ";
+
+ if(mDebugLevel == Error)
+ out<<" ERROR ";
+ if(mDebugLevel == Warning)
+ out<<" WARNING ";
+ }
}
DebugOut const& operator << (string message) const
return *this;
}
- /*DebugOut const & operator << (uint16_t val) const
- {
- ostream out(buf);
-
- if(mDebugLevel <= debugThreshhold)
- out<<val<<" ";
- return *this;
- }*/
-
DebugOut const & operator << (double val) const
{
ostream out(buf);