refactoring of debugManager

This commit is contained in:
Janik Schlemminger
2014-03-28 13:23:03 +01:00
parent 32b11654ce
commit 35ba108cf7
6 changed files with 83 additions and 60 deletions

View File

@@ -23,7 +23,7 @@ void DebugManager::printDebug(string message, Sender sender, Importance importan
pair<Sender, Importance>(sender, importance));
if (show)
{
cout << "[" << importanceToString(importance) << "]";
cout << importanceToString(importance);
if (printTime)
std::cout << " at " << sc_time_stamp();
if (printLocation)
@@ -32,16 +32,25 @@ void DebugManager::printDebug(string message, Sender sender, Importance importan
}
}
void DebugManager::addToWhiteList(Sender sender, Importance importance)
{
whiteList.push_back(pair<Sender, Importance>(sender, importance));
}
void DebugManager::addToWhiteList(Sender sender)
{
addToWhiteList(sender, Importance::Info);
addToWhiteList(sender, Importance::Warning);
}
string DebugManager::importanceToString(Importance importancy)
{
switch (importancy)
{
case Importance::Info:
return "Info";
return "";
case Importance::Warning:
return "Warning";
case Importance::Error:
return "Error";
return "[Warning]";
}
return "unknown importance";
}
@@ -56,6 +65,8 @@ string DebugManager::senderToString(Sender sender)
return "Scheduler";
case Sender::TracePlayer:
return "TracePlayer";
case Sender::TraceRecorder:
return "TraceRecorder";
}
return "unknown sender";
}