refactoring of debugManager
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user