From 576ca241ecaea6f357a13f022fb297976aa967ca Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 23 Jul 2023 00:27:26 +0200 Subject: Core/Logging: Minor compile time reducing refactor of log message formatting --- 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 19523e60cc7..c61ebb2bf85 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -221,17 +221,17 @@ void Log::RegisterAppender(uint8 index, AppenderCreatorFn appenderCreateFn) appenderFactory[index] = appenderCreateFn; } -void Log::OutMessageImpl(std::string_view filter, LogLevel level, std::string&& message) +void Log::OutMessageImpl(std::string_view filter, LogLevel level, Trinity::FormatStringView messageFormat, Trinity::FormatArgs messageFormatArgs) { - write(std::make_unique(level, std::string(filter), std::move(message))); + write(std::make_unique(level, filter, Trinity::StringVFormat(messageFormat, messageFormatArgs))); } -void Log::OutCommandImpl(std::string&& message, std::string&& param1) +void Log::OutCommandImpl(uint32 account, Trinity::FormatStringView messageFormat, Trinity::FormatArgs messageFormatArgs) { - write(std::make_unique(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1))); + write(std::make_unique(LOG_LEVEL_INFO, "commands.gm", Trinity::StringVFormat(messageFormat, messageFormatArgs), Trinity::ToString(account))); } -void Log::write(std::unique_ptr&& msg) const +void Log::write(std::unique_ptr msg) const { Logger const* logger = GetLoggerByType(msg->type); -- cgit v1.2.3