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>

View File

@@ -77,10 +77,10 @@ namespace Acore::Impl::Readline
void utf8print(void* /*arg*/, std::string_view str)
{
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
fmt::print(str);
fmt::print("{}", str);
#else
{
fmt::print(str);
fmt::print("{}", str);
fflush(stdout);
}
#endif

View File

@@ -143,6 +143,11 @@ namespace Acore::ChatCommands
AC_GAME_API ChatCommandResult TryConsume(ChatHandler const* handler, std::string_view args);
};
inline std::string_view format_as(QuotedString const& qs)
{
return std::string_view(qs);
}
struct AC_GAME_API AccountIdentifier : Acore::Impl::ChatCommands::ContainerTag
{
using value_type = uint32;

View File

@@ -20,6 +20,7 @@
#include "GridCell.h"
#include "GridReference.h"
#include <memory>
class GridTerrainData;

View File

@@ -19,6 +19,7 @@
#include "CellImpl.h"
#include "Chat.h"
#include "CommandScript.h"
#include <fmt/ranges.h>
#include "GameObject.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"