chore(deps/fmt): Bump fmt to 12.1.0 (#25444)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Kitzunu
2026-04-14 18:49:13 +02:00
committed by GitHub
parent 472745a944
commit 2a689d7084
32 changed files with 12209 additions and 14171 deletions

View File

@@ -69,13 +69,13 @@ public:
bool SetLogLevel(std::string const& name, int32 level, bool isLogger = true);
template<typename... Args>
inline void outMessage(std::string const& filter, LogLevel const level, Acore::FormatString<Args...> fmt, Args&&... args)
inline void outMessage(std::string const& filter, LogLevel const level, Acore::FormatStringView fmt, Args&&... args)
{
_outMessage(filter, level, Acore::StringFormat(fmt, std::forward<Args>(args)...));
}
template<typename... Args>
void outCommand(uint32 account, Acore::FormatString<Args...> fmt, Args&&... args)
void outCommand(uint32 account, Acore::FormatStringView fmt, Args&&... args)
{
if (!ShouldLog("commands.gm", LOG_LEVEL_INFO))
{
@@ -126,19 +126,6 @@ private:
#define sLog Log::instance()
#define LOG_EXCEPTION_FREE(filterType__, level__, ...) \
{ \
try \
{ \
sLog->outMessage(filterType__, level__, fmt::format(__VA_ARGS__)); \
} \
catch (std::exception const& e) \
{ \
sLog->outMessage("server", LogLevel::LOG_LEVEL_ERROR, "Wrong format occurred ({}) at '{}:{}'", \
e.what(), __FILE__, __LINE__); \
} \
}
#ifdef PERFORMANCE_PROFILING
#define LOG_MESSAGE_BODY(filterType__, level__, ...) ((void)0)
#else
@@ -146,7 +133,7 @@ private:
do \
{ \
if (sLog->ShouldLog(filterType__, level__)) \
LOG_EXCEPTION_FREE(filterType__, level__, __VA_ARGS__); \
sLog->outMessage(filterType__, level__, __VA_ARGS__); \
} while (0)
#endif

View File

@@ -41,29 +41,29 @@ namespace Acore
/// Default AC string format function.
template<typename... Args>
inline std::string StringFormat(FormatString<Args...> fmt, Args&&... args)
inline std::string StringFormat(FormatStringView fmt, Args&&... args)
{
try
{
return fmt::format(fmt, std::forward<Args>(args)...);
return fmt::vformat(fmt, fmt::make_format_args(args...));
}
catch (std::exception const& e)
{
return fmt::format("Wrong format occurred ({}). Fmt string: '{}'", e.what(), fmt.get());
return fmt::format("Wrong format occurred ({}). Fmt string: '{}'", e.what(), fmt);
}
}
/// Format directly to an output iterator.
template<typename OutputIt, typename... Args>
inline OutputIt StringFormatTo(OutputIt out, FormatString<Args...> fmt, Args&&... args)
inline OutputIt StringFormatTo(OutputIt out, FormatStringView fmt, Args&&... args)
{
try
{
return fmt::format_to(out, fmt, std::forward<Args>(args)...);
return fmt::vformat_to(out, fmt, fmt::make_format_args(args...));
}
catch (std::exception const& e)
{
return fmt::format_to(out, "Wrong format occurred ({}). Fmt string: '{}'", e.what(), fmt.get());
return fmt::format_to(out, "Wrong format occurred ({}). Fmt string: '{}'", e.what(), fmt);
}
}

View File

@@ -21,6 +21,7 @@
#include "Util.h"
#include <chrono>
#include <functional>
#include <memory>
#include <optional>
#include <queue>
#include <set>