Sorry but I think I'd like to go now.

This commit is contained in:
tildearrow 2022-04-11 00:12:24 -05:00
parent 92b8703574
commit 9e0e725802
6 changed files with 11 additions and 34 deletions

View file

@ -1,7 +1,5 @@
#include "gui.h"
#include "../ta-log.h"
#include <chrono>
#include "date/tz.h"
const char* logLevels[5]={
"ERROR",
@ -56,11 +54,9 @@ void FurnaceGUI::drawLog() {
const LogEntry& logEntry=logEntries[(pos+i)&(TA_LOG_SIZE-1)];
if (!logEntry.ready) continue;
if (logLevel<logEntry.loglevel) continue;
String t=date::format("%T",date::make_zoned(date::current_zone(),date::floor<std::chrono::seconds>(logEntry.time)));
ImGui::TableNextRow();
ImGui::TableNextColumn();
// this will fail on 32-bit :<
ImGui::TextUnformatted(t.c_str());
ImGui::Text("%02d:%02d:%02d",logEntry.time.tm_hour,logEntry.time.tm_min,logEntry.time.tm_sec);
ImGui::TableNextColumn();
ImGui::TextColored(uiColors[logColors[logEntry.loglevel]],"%s",logLevels[logEntry.loglevel]);
ImGui::TableNextColumn();
@ -75,4 +71,4 @@ void FurnaceGUI::drawLog() {
}
}
ImGui::End();
}
}