merged everythin into one project
This commit is contained in:
50
dram/src/common/DebugManager.cpp
Normal file
50
dram/src/common/DebugManager.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* DebugManager.cpp
|
||||
*
|
||||
* Created on: Mar 20, 2014
|
||||
* Author: jonny
|
||||
*/
|
||||
|
||||
#include "DebugManager.h"
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
DebugManager& DebugManager::getInstance()
|
||||
{
|
||||
static DebugManager manager;
|
||||
return manager;
|
||||
}
|
||||
|
||||
void DebugManager::printDebug(Importance importancy, Sender sender, sc_time time, std::string message)
|
||||
{
|
||||
cout << "[" << importancyToString(importancy) << "]";
|
||||
if(printTime) std::cout << " at " << time;
|
||||
if(printLocation) std::cout << " in " << senderToString(sender);
|
||||
cout << ": " << message << endl;
|
||||
}
|
||||
|
||||
string DebugManager::importancyToString(Importance importancy)
|
||||
{
|
||||
//if((unsigned int)importancy == Importancy::Warning)
|
||||
// return "Warning";
|
||||
|
||||
switch(importancy)
|
||||
{
|
||||
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)
|
||||
{
|
||||
case Sender::Core: return "Core";
|
||||
case Sender::Scheduler: return "Scheduler";
|
||||
}*/
|
||||
return "Core";
|
||||
}
|
||||
Reference in New Issue
Block a user