From 084c282ce2c881553e30c161fb6e286e57c997e3 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Fri, 23 Sep 2022 20:56:17 +0200 Subject: [PATCH] Log processpriority changes --- GlosSITarget/ProcessPriority.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GlosSITarget/ProcessPriority.h b/GlosSITarget/ProcessPriority.h index f63a429..60528e8 100644 --- a/GlosSITarget/ProcessPriority.h +++ b/GlosSITarget/ProcessPriority.h @@ -12,6 +12,7 @@ static int current_priority = HIGH_PRIORITY_CLASS; inline void init() { SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); + spdlog::trace("Set process priority to HIGH_PRIORITY_CLASS"); Overlay::AddOverlayElem([](bool window_has_focus, ImGuiID dockspace_id) { ImGui::SetNextWindowDockID(dockspace_id, ImGuiCond_FirstUseEver); @@ -20,26 +21,32 @@ inline void init() if (ImGui::RadioButton("Realtime", current_priority == REALTIME_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); current_priority = REALTIME_PRIORITY_CLASS; + spdlog::trace("Set process priority to REALTIME_PRIORITY_CLASS"); } if (ImGui::RadioButton("High", current_priority == HIGH_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); current_priority = HIGH_PRIORITY_CLASS; + spdlog::trace("Set process priority to HIGH_PRIORITY_CLASS"); } if (ImGui::RadioButton("Above Normal", current_priority == ABOVE_NORMAL_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS); current_priority = ABOVE_NORMAL_PRIORITY_CLASS; + spdlog::trace("Set process priority to ABOVE_NORMAL_PRIORITY_CLASS"); } if (ImGui::RadioButton("Normal", current_priority == NORMAL_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); current_priority = NORMAL_PRIORITY_CLASS; + spdlog::trace("Set process priority to NORMAL_PRIORITY_CLASS"); } if (ImGui::RadioButton("Below Normal", current_priority == BELOW_NORMAL_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); current_priority = BELOW_NORMAL_PRIORITY_CLASS; + spdlog::trace("Set process priority to BELOW_NORMAL_PRIORITY_CLASS"); } if (ImGui::RadioButton("Low", current_priority == IDLE_PRIORITY_CLASS)) { SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); current_priority = IDLE_PRIORITY_CLASS; + spdlog::trace("Set process priority to IDLE_PRIORITY_CLASS"); } ImGui::End(); });