resources folder
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "DebugManager.h"
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -18,30 +19,43 @@ DebugManager& DebugManager::getInstance()
|
||||
|
||||
void DebugManager::printDebug(string message, Sender sender, Importance importance)
|
||||
{
|
||||
cout << "[" << importanceToString(importance) << "]";
|
||||
if(printTime) std::cout << " at " << sc_time_stamp();
|
||||
if(printLocation) std::cout << " in " << senderToString(sender);
|
||||
cout << ": " << message << endl;
|
||||
bool show = count(whiteList.begin(), whiteList.end(),
|
||||
pair<Sender, Importance>(sender, importance));
|
||||
if (show)
|
||||
{
|
||||
cout << "[" << importanceToString(importance) << "]";
|
||||
if (printTime)
|
||||
std::cout << " at " << sc_time_stamp();
|
||||
if (printLocation)
|
||||
std::cout << " in " << senderToString(sender);
|
||||
cout << ": " << message << endl;
|
||||
}
|
||||
}
|
||||
|
||||
string DebugManager::importanceToString(Importance importancy)
|
||||
{
|
||||
switch(importancy)
|
||||
switch (importancy)
|
||||
{
|
||||
case Importance::Info: return "[Info]";
|
||||
case Importance::Warning: return "[Warning]";
|
||||
case Importance::Error: return "[Error]";
|
||||
case Importance::Info:
|
||||
return "Info";
|
||||
case Importance::Warning:
|
||||
return "Warning";
|
||||
case Importance::Error:
|
||||
return "Error";
|
||||
}
|
||||
return "unknown importance";
|
||||
}
|
||||
|
||||
string DebugManager::senderToString(Sender sender)
|
||||
{
|
||||
switch(sender)
|
||||
switch (sender)
|
||||
{
|
||||
case Sender::Core: return "Core";
|
||||
case Sender::Scheduler: return "Scheduler";
|
||||
case Sender::TracePlayer: return "TracePlayer";
|
||||
case Sender::Core:
|
||||
return "Core";
|
||||
case Sender::Scheduler:
|
||||
return "Scheduler";
|
||||
case Sender::TracePlayer:
|
||||
return "TracePlayer";
|
||||
}
|
||||
return "unknown sender";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user