From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/core/StarLogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/core/StarLogging.cpp') diff --git a/source/core/StarLogging.cpp b/source/core/StarLogging.cpp index 2a7f88e..55cd27d 100644 --- a/source/core/StarLogging.cpp +++ b/source/core/StarLogging.cpp @@ -24,7 +24,7 @@ LogLevel LogSink::level() { void StdoutLogSink::log(char const* msg, LogLevel level) { MutexLocker locker(m_logMutex); - coutf("[%s] %s\n", LogLevelNames.getRight(level), msg); + coutf("[{}] {}\n", LogLevelNames.getRight(level), msg); } FileLogSink::FileLogSink(String const& filename, LogLevel level, bool truncate) { @@ -37,7 +37,7 @@ FileLogSink::FileLogSink(String const& filename, LogLevel level, bool truncate) void FileLogSink::log(char const* msg, LogLevel level) { MutexLocker locker(m_logMutex); - auto line = strf("[%s] [%s] %s\n", Time::printCurrentDateAndTime("::."), LogLevelNames.getRight(level), msg); + auto line = strf("[{}] [{}] {}\n", Time::printCurrentDateAndTime("::."), LogLevelNames.getRight(level), msg); m_output->write(line.data(), line.size()); } -- cgit v1.2.3