Added log counter in logger window to avoid spamming

This commit is contained in:
Antoine Pilote
2023-10-02 01:36:17 -04:00
parent fc7645b4c6
commit 429ec7e5fa
2 changed files with 10 additions and 2 deletions

View File

@@ -9,8 +9,14 @@ namespace Nuake
{
std::vector<LogEntry> Logger::m_Logs = std::vector<LogEntry>();
void Logger::Log(const std::string& log, const std::string& logger ,LOG_TYPE type)
void Logger::Log(const std::string& log, const std::string& logger, LOG_TYPE type)
{
if (!m_Logs.empty() && m_Logs.back().message == log)
{
m_Logs.back().count += 1;
return;
}
char buff[100];
time_t now = time(0);
struct tm timeinfo;
@@ -30,7 +36,8 @@ namespace Nuake
type,
buff,
log,
logger
logger,
0
};
switch (type)

View File

@@ -17,6 +17,7 @@ namespace Nuake
std::string time;
std::string message;
std::string logger;
uint32_t count;
};
class Logger