From d791afae1dfcfaf592326f787755ca32d629e4d3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Jan 2023 21:16:53 +0100 Subject: Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) --- src/common/Threading/ProcessPriority.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/common/Threading/ProcessPriority.cpp') diff --git a/src/common/Threading/ProcessPriority.cpp b/src/common/Threading/ProcessPriority.cpp index aafc1c49b04..135c6396d67 100644 --- a/src/common/Threading/ProcessPriority.cpp +++ b/src/common/Threading/ProcessPriority.cpp @@ -44,11 +44,11 @@ void SetProcessPriority(std::string const& logChannel, uint32 affinity, bool hig ULONG_PTR currentAffinity = affinity & appAff; if (!currentAffinity) - TC_LOG_ERROR(logChannel, "Processors marked in UseProcessors bitmask (hex) %x are not accessible. Accessible processors bitmask (hex): %x", affinity, appAff); + TC_LOG_ERROR(logChannel, "Processors marked in UseProcessors bitmask (hex) {:x} are not accessible. Accessible processors bitmask (hex): {:x}", affinity, appAff); else if (SetProcessAffinityMask(hProcess, currentAffinity)) - TC_LOG_INFO(logChannel, "Using processors (bitmask, hex): %x", currentAffinity); + TC_LOG_INFO(logChannel, "Using processors (bitmask, hex): {:x}", currentAffinity); else - TC_LOG_ERROR(logChannel, "Can't set used processors (hex): %x", currentAffinity); + TC_LOG_ERROR(logChannel, "Can't set used processors (hex): {:x}", currentAffinity); } } @@ -72,21 +72,21 @@ void SetProcessPriority(std::string const& logChannel, uint32 affinity, bool hig CPU_SET(i, &mask); if (sched_setaffinity(0, sizeof(mask), &mask)) - TC_LOG_ERROR(logChannel, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); + TC_LOG_ERROR(logChannel, "Can't set used processors (hex): {:x}, error: {}", affinity, strerror(errno)); else { CPU_ZERO(&mask); sched_getaffinity(0, sizeof(mask), &mask); - TC_LOG_INFO(logChannel, "Using processors (bitmask, hex): %lx", *(__cpu_mask*)(&mask)); + TC_LOG_INFO(logChannel, "Using processors (bitmask, hex): {:x}", *(__cpu_mask*)(&mask)); } } if (highPriority) { if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) - TC_LOG_ERROR(logChannel, "Can't set process priority class, error: %s", strerror(errno)); + TC_LOG_ERROR(logChannel, "Can't set process priority class, error: {}", strerror(errno)); else - TC_LOG_INFO(logChannel, "Process priority class set to %i", getpriority(PRIO_PROCESS, 0)); + TC_LOG_INFO(logChannel, "Process priority class set to {}", getpriority(PRIO_PROCESS, 0)); } #else -- cgit v1.2.3