From 8e23b27d6ef6acdb245a7463021d2c5253ddd5fd Mon Sep 17 00:00:00 2001 From: Alexander Barker Date: Thu, 23 Sep 2021 10:16:23 -0700 Subject: [PATCH] Changing input_helper, input_hook and system_properties logging to be less verbose. --- src/darwin/system_properties.c | 2 +- src/windows/input_helper.c | 2 +- src/windows/input_hook.c | 2 +- src/windows/system_properties.c | 18 +++++++++--------- src/x11/input_hook.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/darwin/system_properties.c b/src/darwin/system_properties.c index 0f8bc0b2..2abac85c 100644 --- a/src/darwin/system_properties.c +++ b/src/darwin/system_properties.c @@ -88,7 +88,7 @@ UIOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) { } } } else { - logger(LOG_LEVEL_DEBUG, "%s [%u]: multiple_get_screen_info failed: %ld. Fallback.\n", + logger(LOG_LEVEL_WARN, "%s [%u]: multiple_get_screen_info failed: %ld. Fallback.\n", __FUNCTION__, __LINE__, status); size_t width = CGDisplayPixelsWide(CGMainDisplayID()); diff --git a/src/windows/input_helper.c b/src/windows/input_helper.c index 1837d7fd..b113b8d6 100644 --- a/src/windows/input_helper.c +++ b/src/windows/input_helper.c @@ -692,7 +692,7 @@ SIZE_T keycode_to_unicode(DWORD keycode, PWCHAR buffer, SIZE_T size) { // Check and make sure the Unicode helper was loaded. if (locale_current != NULL) { - logger(LOG_LEVEL_INFO, + logger(LOG_LEVEL_DEBUG, "%s [%u]: Using keyboard layout %#p.\n", __FUNCTION__, __LINE__, locale_current->id); diff --git a/src/windows/input_hook.c b/src/windows/input_hook.c index dd5845d4..f2600111 100644 --- a/src/windows/input_hook.c +++ b/src/windows/input_hook.c @@ -612,7 +612,7 @@ LRESULT CALLBACK mouse_hook_event_proc(int nCode, WPARAM wParam, LPARAM lParam) void CALLBACK win_hook_event_proc(HWINEVENTHOOK hook, DWORD event, HWND hWnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) { switch (event) { case EVENT_OBJECT_NAMECHANGE: - logger(LOG_LEVEL_INFO, "%s [%u]: Restarting Windows input hook on window event: %#X.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: Restarting Windows input hook on window event: %#X.\n", __FUNCTION__, __LINE__, event); // Remove any keyboard or mouse hooks that are still running. diff --git a/src/windows/system_properties.c b/src/windows/system_properties.c index ff8a5329..861f7966 100644 --- a/src/windows/system_properties.c +++ b/src/windows/system_properties.c @@ -68,7 +68,7 @@ static BOOL CALLBACK monitor_enum_proc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT .height = height }; - logger(LOG_LEVEL_INFO, "%s [%u]: Monitor %d: %ldx%ld (%ld, %ld)\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: Monitor %d: %ldx%ld (%ld, %ld)\n", __FUNCTION__, __LINE__, screens->count, width, height, origin_x, origin_y); } @@ -92,7 +92,7 @@ UIOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) { if (!status || screens.count == 0) { // Fallback in case EnumDisplayMonitors fails. - logger(LOG_LEVEL_INFO, "%s [%u]: EnumDisplayMonitors failed. Fallback.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: EnumDisplayMonitors failed. Fallback.\n", __FUNCTION__, __LINE__); int width = GetSystemMetrics(SM_CXSCREEN); @@ -125,7 +125,7 @@ UIOHOOK_API long int hook_get_auto_repeat_rate() { long int rate; if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &rate, 0)) { - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETKEYBOARDSPEED: %li.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETKEYBOARDSPEED: %li.\n", __FUNCTION__, __LINE__, rate); value = rate; @@ -139,7 +139,7 @@ UIOHOOK_API long int hook_get_auto_repeat_delay() { long int delay; if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &delay, 0)) { - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETKEYBOARDDELAY: %li.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETKEYBOARDDELAY: %li.\n", __FUNCTION__, __LINE__, delay); value = delay; @@ -153,7 +153,7 @@ UIOHOOK_API long int hook_get_pointer_acceleration_multiplier() { int mouse[3]; // 0-Threshold X, 1-Threshold Y and 2-Speed. if (SystemParametersInfo(SPI_GETMOUSE, 0, &mouse, 0)) { - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[2]: %i.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[2]: %i.\n", __FUNCTION__, __LINE__, mouse[2]); value = mouse[2]; @@ -167,9 +167,9 @@ UIOHOOK_API long int hook_get_pointer_acceleration_threshold() { int mouse[3]; // 0-Threshold X, 1-Threshold Y and 2-Speed. if (SystemParametersInfo(SPI_GETMOUSE, 0, &mouse, 0)) { - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[0]: %i.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[0]: %i.\n", __FUNCTION__, __LINE__, mouse[0]); - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSE[1]: %i.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSE[1]: %i.\n", __FUNCTION__, __LINE__, mouse[1]); // Average the x and y thresholds. @@ -184,7 +184,7 @@ UIOHOOK_API long int hook_get_pointer_sensitivity() { int sensitivity; if (SystemParametersInfo(SPI_GETMOUSESPEED, 0, &sensitivity, 0)) { - logger(LOG_LEVEL_INFO, "%s [%u]: SPI_GETMOUSESPEED: %i.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: SPI_GETMOUSESPEED: %i.\n", __FUNCTION__, __LINE__, sensitivity); value = sensitivity; @@ -198,7 +198,7 @@ UIOHOOK_API long int hook_get_multi_click_time() { UINT clicktime; clicktime = GetDoubleClickTime(); - logger(LOG_LEVEL_INFO, "%s [%u]: GetDoubleClickTime: %u.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: GetDoubleClickTime: %u.\n", __FUNCTION__, __LINE__, (unsigned int) clicktime); value = (long int) clicktime; diff --git a/src/x11/input_hook.c b/src/x11/input_hook.c index 64854173..e11e2af7 100644 --- a/src/x11/input_hook.c +++ b/src/x11/input_hook.c @@ -931,7 +931,7 @@ static int xrecord_query() { // Check to make sure XRecord is installed and enabled. int major, minor; if (XRecordQueryVersion(hook->ctrl.display, &major, &minor) != 0) { - logger(LOG_LEVEL_INFO, "%s [%u]: XRecord version: %i.%i.\n", + logger(LOG_LEVEL_DEBUG, "%s [%u]: XRecord version: %i.%i.\n", __FUNCTION__, __LINE__, major, minor); status = xrecord_alloc();