aboutsummaryrefslogtreecommitdiff
path: root/src/common/Logging/Log.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-07-23 00:27:26 +0200
committerShauren <shauren.trinity@gmail.com>2023-08-15 22:03:47 +0200
commit26836f865511f0f6a48c930264537637eb313cd4 (patch)
tree6a77f352a9f1de9423e46a05721266f9b89cd504 /src/common/Logging/Log.cpp
parent4e6118c919bd1f3cd864526345c0b9b7abcbb2e4 (diff)
Core/Logging: Minor compile time reducing refactor of log message formatting
(cherry picked from commit 576ca241ecaea6f357a13f022fb297976aa967ca)
Diffstat (limited to 'src/common/Logging/Log.cpp')
-rw-r--r--src/common/Logging/Log.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 2e7e39e62ec..304cee0fbfa 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -214,17 +214,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<LogMessage>(level, std::string(filter), std::move(message)));
+ write(std::make_unique<LogMessage>(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<LogMessage>(LOG_LEVEL_INFO, "commands.gm", std::move(message), std::move(param1)));
+ write(std::make_unique<LogMessage>(LOG_LEVEL_INFO, "commands.gm", Trinity::StringVFormat(messageFormat, messageFormatArgs), Trinity::ToString(account)));
}
-void Log::write(std::unique_ptr<LogMessage>&& msg) const
+void Log::write(std::unique_ptr<LogMessage> msg) const
{
Logger const* logger = GetLoggerByType(msg->type);