From aaa6e73c8ca6d60e943cb964605536eb78219db2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 15 Aug 2023 20:10:04 +0200 Subject: Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) (cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3) --- src/common/Logging/Log.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/common/Logging/Log.cpp') diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index 96dadcb82c5..2e7e39e62ec 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -214,12 +214,12 @@ void Log::RegisterAppender(uint8 index, AppenderCreatorFn appenderCreateFn) appenderFactory[index] = appenderCreateFn; } -void Log::outMessage(std::string const& filter, LogLevel level, std::string&& message) +void Log::OutMessageImpl(std::string_view filter, LogLevel level, std::string&& message) { - write(std::make_unique(level, filter, std::move(message))); + write(std::make_unique(level, std::string(filter), std::move(message))); } -void Log::outCommand(std::string&& message, std::string&& param1) +void Log::OutCommandImpl(std::string&& message, std::string&& param1) { write(std::make_unique(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1))); } @@ -267,7 +267,7 @@ std::string Log::GetTimestampStr() // HH hour (2 digits 00-23) // MM minutes (2 digits 00-59) // SS seconds (2 digits 00-59) - return Trinity::StringFormat("%04d-%02d-%02d_%02d-%02d-%02d", + return Trinity::StringFormat("{:04}-{:02}-{:02}_{:02}-{:02}-{:02}", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec); } @@ -304,7 +304,7 @@ bool Log::SetLogLevel(std::string const& name, int32 newLeveli, bool isLogger /* return true; } -void Log::outCharDump(char const* str, uint32 accountId, uint64 guid, char const* name) +void Log::OutCharDump(char const* str, uint32 accountId, uint64 guid, char const* name) { if (!str || !ShouldLog("entities.player.dump", LOG_LEVEL_INFO)) return; -- cgit v1.2.3