From 055767399abab0eff6f55acbf480e54fcd83f6bd Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 4 Nov 2026 18:59:40 -0600 Subject: Common/Logging/LogManager: Pass string_view instead of char* to give fmt string length awareness without having to perform strlen calls. --- Source/Core/Common/Logging/LogManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/Logging/LogManager.cpp') diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index ae3ea6a66c..0bc51bfa5b 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -69,7 +69,7 @@ void GenericLogFmtImpl(LogLevel level, LogType type, const char* file, int line, return; const auto message = fmt::vformat(format, args); - instance->Log(level, type, file, line, message.c_str()); + instance->Log(level, type, file, line, message); } static consteval size_t GetPathCutOffPoint() @@ -191,7 +191,8 @@ void LogManager::SaveSettings() Config::Save(); } -void LogManager::Log(LogLevel level, LogType type, const char* file, int line, const char* message) +void LogManager::Log(LogLevel level, LogType type, const char* file, int line, + std::string_view message) { LogWithFullPath(level, type, file + GetPathCutOffPoint(), line, message); } @@ -209,7 +210,7 @@ std::string LogManager::GetTimestamp() } void LogManager::LogWithFullPath(LogLevel level, LogType type, const char* file, int line, - const char* message) + std::string_view message) { const std::string msg = fmt::format("{} {}:{} {}[{}]: {}\n", GetTimestamp(), file, line, -- cgit v1.2.3