aboutsummaryrefslogtreecommitdiff
path: root/src/common/Threading/ProcessPriority.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-08-15 20:10:04 +0200
committerShauren <shauren.trinity@gmail.com>2023-08-15 20:10:04 +0200
commitaaa6e73c8ca6d60e943cb964605536eb78219db2 (patch)
treef5a0187925e646ef071d647efa7a5dac20501813 /src/common/Threading/ProcessPriority.cpp
parent825c697a764017349ca94ecfca8f30a8365666c0 (diff)
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
(cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3)
Diffstat (limited to 'src/common/Threading/ProcessPriority.cpp')
-rw-r--r--src/common/Threading/ProcessPriority.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/Threading/ProcessPriority.cpp b/src/common/Threading/ProcessPriority.cpp
index 3428a56258c..5c0077c0cc5 100644
--- a/src/common/Threading/ProcessPriority.cpp
+++ b/src/common/Threading/ProcessPriority.cpp
@@ -43,11 +43,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);
}
}
@@ -71,21 +71,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