summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Logging/LogManager.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2026-11-04 18:59:40 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2026-11-08 13:08:09 -0600
commit055767399abab0eff6f55acbf480e54fcd83f6bd (patch)
tree3c9ffa237f5cad87887e5e4eebb9e87395135270 /Source/Core/Common/Logging/LogManager.cpp
parentd02fc5f4bb1733a0cfd45ee00b4a8e3ff2a53ca3 (diff)
Common/Logging/LogManager: Pass string_view instead of char* to give fmt string length awareness without having to perform strlen calls.
Diffstat (limited to 'Source/Core/Common/Logging/LogManager.cpp')
-rw-r--r--Source/Core/Common/Logging/LogManager.cpp7
1 files changed, 4 insertions, 3 deletions
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,