diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-07-23 00:27:26 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-07-23 00:27:26 +0200 |
commit | 576ca241ecaea6f357a13f022fb297976aa967ca (patch) | |
tree | ca7080859e2755f9103d0dea538d7fbf2348b333 /src/common/Logging/Log.h | |
parent | 3be66cee2642f67c4fbe200cb3b056b8d68735dd (diff) |
Core/Logging: Minor compile time reducing refactor of log message formatting
Diffstat (limited to 'src/common/Logging/Log.h')
-rw-r--r-- | src/common/Logging/Log.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index f835031aa2f..1e413ece0bb 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -71,7 +71,7 @@ class TC_COMMON_API Log template<typename... Args> void OutMessage(std::string_view filter, LogLevel const level, Trinity::FormatString<Args...> fmt, Args&&... args) { - OutMessageImpl(filter, level, Trinity::StringFormat(fmt, std::forward<Args>(args)...)); + OutMessageImpl(filter, level, fmt, Trinity::MakeFormatArgs(args...)); } template<typename... Args> @@ -80,7 +80,7 @@ class TC_COMMON_API Log if (!ShouldLog("commands.gm", LOG_LEVEL_INFO)) return; - OutCommandImpl(Trinity::StringFormat(fmt, std::forward<Args>(args)...), std::to_string(account)); + OutCommandImpl(account, fmt, Trinity::MakeFormatArgs(args...)); } void OutCharDump(char const* str, uint32 account_id, uint64 guid, char const* name); @@ -101,7 +101,7 @@ class TC_COMMON_API Log private: static std::string GetTimestampStr(); - void write(std::unique_ptr<LogMessage>&& msg) const; + void write(std::unique_ptr<LogMessage> msg) const; Logger const* GetLoggerByType(std::string_view type) const; Appender* GetAppenderByName(std::string_view name); @@ -111,8 +111,8 @@ class TC_COMMON_API Log void ReadAppendersFromConfig(); void ReadLoggersFromConfig(); void RegisterAppender(uint8 index, AppenderCreatorFn appenderCreateFn); - void OutMessageImpl(std::string_view filter, LogLevel level, std::string&& message); - void OutCommandImpl(std::string&& message, std::string&& param1); + void OutMessageImpl(std::string_view filter, LogLevel level, Trinity::FormatStringView messageFormat, Trinity::FormatArgs messageFormatArgs); + void OutCommandImpl(uint32 account, Trinity::FormatStringView messageFormat, Trinity::FormatArgs messageFormatArgs); std::unordered_map<uint8, AppenderCreatorFn> appenderFactory; std::unordered_map<uint8, std::unique_ptr<Appender>> appenders; |