diff --git a/lib/libimhex/include/hex/api/localization.hpp b/lib/libimhex/include/hex/api/localization.hpp index 428ef582b..723a9a428 100644 --- a/lib/libimhex/include/hex/api/localization.hpp +++ b/lib/libimhex/include/hex/api/localization.hpp @@ -5,6 +5,8 @@ #include #include +#include + namespace hex { class LanguageDefinition { @@ -56,4 +58,12 @@ namespace hex { return LangEntry(string); } -} \ No newline at end of file +} + +template<> +struct fmt::formatter : fmt::formatter { + template + auto format(const hex::LangEntry &entry, FormatContext &ctx) { + return fmt::formatter::format(entry, ctx); + } +}; \ No newline at end of file diff --git a/lib/libimhex/include/hex/helpers/logger.hpp b/lib/libimhex/include/hex/helpers/logger.hpp index 62f95c1f9..4f212b365 100644 --- a/lib/libimhex/include/hex/helpers/logger.hpp +++ b/lib/libimhex/include/hex/helpers/logger.hpp @@ -17,7 +17,7 @@ namespace hex::log { namespace { [[maybe_unused]] void printPrefix(FILE *dest, const fmt::text_style &ts, const std::string &level) { - const auto now = fmt::localtime(std::chrono::system_clock::now()); + const auto now = fmt::localtime(std::chrono::system_clock::to_time_t(std::chrono::system_clock::now())); fmt::print(dest, "[{0:%H:%M:%S}] ", now); diff --git a/lib/libimhex/source/helpers/logger.cpp b/lib/libimhex/source/helpers/logger.cpp index 13f6f7871..073b8b060 100644 --- a/lib/libimhex/source/helpers/logger.cpp +++ b/lib/libimhex/source/helpers/logger.cpp @@ -24,7 +24,7 @@ namespace hex::log { for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Logs, true)) { wolv::io::fs::createDirectories(path); - g_loggerFile = wolv::io::File(path / hex::format("{0:%Y%m%d_%H%M%S}.log", fmt::localtime(std::chrono::system_clock::now())), wolv::io::File::Mode::Create); + g_loggerFile = wolv::io::File(path / hex::format("{0:%Y%m%d_%H%M%S}.log", fmt::localtime(std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()))), wolv::io::File::Mode::Create); g_loggerFile.disableBuffering(); if (g_loggerFile.isValid()) break;