Fixed dependency for glibc or smth ig
Some checks failed
Build VulkanEngine / nix (push) Successful in 5m53s
Build VulkanEngine / release (BUNDLE) (push) Failing after 2m59s
Build VulkanEngine / release (PORTABLE) (push) Failing after 2m58s
Build VulkanEngine / notify (push) Successful in 3s

This commit is contained in:
Alexandre 2026-10-09 22:59:00 +02:00
parent bbf7950bfa
commit 4874a49aaa
2 changed files with 17 additions and 4 deletions

View File

@ -110,6 +110,9 @@ class Logger {
// Helper functions
static std::string_view moduleToString(LogModule m);
static std::string_view levelToString(LogLevel l);
inline std::string formatTimestamp(
std::chrono::system_clock::time_point tp
);
};
#endif // End of header
@ -140,8 +143,7 @@ void Logger::logRAM(
Args&&... args
) {
auto now { std::chrono::system_clock::now() };
now = std::chrono::zoned_time{ std::chrono::current_zone(), now };
auto timestamp = std::format("{:%Y-%m-%d %H:%M}", now);
auto timestamp = formatTimestamp(now);
auto start = logBuffer.size();
fmt::format_to(
@ -177,7 +179,7 @@ void Logger::logConsole(
) {
std::string tempBuffer;
auto now = std::chrono::system_clock::now();
auto timestamp = std::format("{:%Y-%m-%d %H:%M}", now);
auto timestamp = formatTimestamp(now);
fmt::format_to(
std::back_inserter(tempBuffer),
@ -219,7 +221,7 @@ void Logger::logDisk(
// Create a temporary buffer
std::string tempBuffer;
auto now = std::chrono::system_clock::now();
auto timestamp = std::format("{:%Y-%m-%d %H:%M}", now);
auto timestamp = formatTimestamp(now);
fmt::format_to(
std::back_inserter(tempBuffer),
@ -379,5 +381,14 @@ std::string_view Logger::levelToString(LogLevel l) {
}
}
std::string Logger::formatTimestamp(
std::chrono::system_clock::time_point tp
) {
std::time_t t = std::chrono::system_clock::to_time_t(tp);
std::tm tm{};
localtime_r(&t, &tm);
return fmt::format("{:%Y-%m-%d %H:%M}", tm);
}
#endif
#endif

View File

@ -12,6 +12,8 @@
#include <chrono>
#include <thread>
#include <fmt/base.h>
#include <fmt/format.h>
#include <fmt/chrono.h>
#include <stdexcept>
#include <cstdint>