debugging

This commit is contained in:
Dhanya Maliakal 2016-11-08 11:05:49 +01:00
parent 385941d75e
commit cf5978d730

View File

@ -46,6 +46,7 @@ void error(const char *location, const char *msg){
inline std::string NowTime(); inline std::string NowTime();
enum TLogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5}; enum TLogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5};
static const char TLevelValues[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4","DEBUG5"};
template <typename T> class Log{ template <typename T> class Log{
public: public:
@ -169,8 +170,9 @@ template <typename T> TLogLevel& Log<T>::ReportingLevel()
template <typename T> std::string Log<T>::ToString(TLogLevel level) template <typename T> std::string Log<T>::ToString(TLogLevel level)
{ {
static const char* const buffer[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4","DEBUG5"}; /*static const char* const buffer[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4","DEBUG5"};
return buffer[level]; return buffer[level];*/
return TLevelValues[level];
} }
template <typename T> template <typename T>