Major cleanup.

Moved to namespace
Cleanup includes
This commit is contained in:
Antoine Pilote
2021-07-11 18:56:44 -04:00
parent f77bef6b28
commit 0c6ed48bbd
174 changed files with 11772 additions and 11296 deletions

View File

@@ -4,30 +4,33 @@
#include <string>
#include <time.h>
std::vector<LogEntry> Logger::m_Logs = std::vector<LogEntry>();
void Logger::Log(std::string log, LOG_TYPE type)
namespace Nuake
{
char buff[100];
time_t now = time(0);
strftime(buff, 100, "%Y-%m-%d %H:%M:%S.000", localtime(&now));
std::vector<LogEntry> Logger::m_Logs = std::vector<LogEntry>();
LogEntry newLog = {
type,
buff,
log
};
void Logger::Log(std::string log, LOG_TYPE type)
{
char buff[100];
time_t now = time(0);
strftime(buff, 100, "%Y-%m-%d %H:%M:%S.000", localtime(&now));
std::string msg = "[" + std::string(buff) + "]" + std::string(" - ") + log;
printf((msg + "\n").c_str());
LogEntry newLog = {
type,
buff,
log
};
if (m_Logs.size() >= MAX_LOG)
m_Logs.erase(m_Logs.begin());
std::string msg = "[" + std::string(buff) + "]" + std::string(" - ") + log;
printf((msg + "\n").c_str());
m_Logs.push_back(newLog);
if (m_Logs.size() >= MAX_LOG)
m_Logs.erase(m_Logs.begin());
m_Logs.push_back(newLog);
}
std::vector<LogEntry> Logger::GetLogs()
{
return m_Logs;
}
}
std::vector<LogEntry> Logger::GetLogs()
{
return m_Logs;
}