From 5b88d58dae94d0981f3c78943ed381ccf16b90dd Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 16 Jul 2026 21:11:53 +0300 Subject: [PATCH] fix: demote spam auto_connect logs to DEBUG_DEBUG Remain at INFO: attempt + result FAIL. Demoted to DEBUG: TIMEOUT, CANCELLED, GC closing, flight launched, AUTO_CONNECT in_progress. --- tools/chatgui/transport/chat_core.c | 8 ++++---- tools/chatgui/transport/chat_sync.c | 4 ++-- tools/chatgui/transport/gui_bridge_impl.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/chatgui/transport/chat_core.c b/tools/chatgui/transport/chat_core.c index f78f10d8..1221ee2f 100644 --- a/tools/chatgui/transport/chat_core.c +++ b/tools/chatgui/transport/chat_core.c @@ -837,8 +837,8 @@ static void ca_timeout_cb(void* arg) { if (st->delivered || st->cancelled) return; st->timers[ctx->addr_index] = NULL; st->pending_count--; - DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: auto_connect TIMEOUT idx=%d pending=%d/%d peer=0x%016llx", - CC_ID, ctx->addr_index, st->pending_count, st->addr_count, (unsigned long long)st->node_id); + DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTIVITY, "%s: auto_connect TIMEOUT idx=%d pending=%d/%d peer=0x%016llx", + CC_ID, ctx->addr_index, st->pending_count, st->addr_count, (unsigned long long)st->node_id); if (st->pending_count <= 0 && !st->delivered) { st->delivered = 1; st->result_cb(CONN_MGR_ERR_TIMEOUT, st->node_id, st->result_arg); @@ -849,8 +849,8 @@ void chat_core_connect_auto_cancel(void* state) { if (!state) return; struct ca_state* st = (struct ca_state*)state; st->cancelled = 1; - DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: auto_connect CANCELLED peer=0x%016llx", - CC_ID, (unsigned long long)st->node_id); + DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTIVITY, "%s: auto_connect CANCELLED peer=0x%016llx", + CC_ID, (unsigned long long)st->node_id); for (int i = 0; i < st->addr_count; i++) { if (st->timers[i]) { uasync_cancel_timeout(st->inst->ua, st->timers[i]); st->timers[i] = NULL; } if (st->conns[i]) { etcp_connection_close(st->conns[i]); st->conns[i] = NULL; } diff --git a/tools/chatgui/transport/chat_sync.c b/tools/chatgui/transport/chat_sync.c index e32289fa..535a3503 100644 --- a/tools/chatgui/transport/chat_sync.c +++ b/tools/chatgui/transport/chat_sync.c @@ -110,7 +110,7 @@ static void ac_gc(struct auto_connect* ac) { continue; } /* expired and not up — cancel */ - DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: GC closing flight node=0x%016llx (expired)", AC_ID, (unsigned long long)nid); + DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTIVITY, "%s: GC closing flight node=0x%016llx (expired)", AC_ID, (unsigned long long)nid); chat_core_connect_auto_cancel(ac->flights[i].ca_state); memset(&ac->flights[i], 0, sizeof(ac->flights[i])); } @@ -185,7 +185,7 @@ static void ac_fill(struct auto_connect* ac) { f->node_id = 0; f->created_tb = 0; continue; } - DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: flight[%d] launched node=0x%016llx", AC_ID, slot, (unsigned long long)nid); + DEBUG_DEBUG(DEBUG_CATEGORY_CONNECTIVITY, "%s: flight[%d] launched node=0x%016llx", AC_ID, slot, (unsigned long long)nid); uint8_t evt[7]; evt[0] = 0; uint16_t t = 0, n = (uint16_t)ac->channel_count, s = 0; memcpy(evt + 1, &t, 2); memcpy(evt + 3, &n, 2); memcpy(evt + 5, &s, 2); gui_bridge_post(GUI_EVT_AUTO_CONNECT_STATUS, evt, 7); diff --git a/tools/chatgui/transport/gui_bridge_impl.cpp b/tools/chatgui/transport/gui_bridge_impl.cpp index 40ac7ec9..85ce30d7 100644 --- a/tools/chatgui/transport/gui_bridge_impl.cpp +++ b/tools/chatgui/transport/gui_bridge_impl.cpp @@ -108,7 +108,7 @@ void GuiBridgeReceiver::processPost(int eventType, QByteArray data) { uint16_t node_count; memcpy(&node_count, d + 3, 2); uint16_t connected; memcpy(&connected, d + 5, 2); const char* st_str = status == 0 ? "in_progress" : status == 1 ? "done" : "stopped"; - DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "gui_bridge: AUTO_CONNECT %s tried=%u/%u connected=%u", st_str, total_tried, node_count, connected); + if (status != 0) DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "gui_bridge: AUTO_CONNECT %s tried=%u/%u connected=%u", st_str, total_tried, node_count, connected); if (g_auto_connect_status_cb) g_auto_connect_status_cb(status, total_tried, node_count, connected); } break;