mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user