From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uLfbMeMnoWBjRgEAgWs5BA (envelope-from ) for ; Sun, 16 May 2021 16:10:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yLR9LeMnoWClOwAA1q6Kng (envelope-from ) for ; Sun, 16 May 2021 14:10:43 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 84D7A11BED for ; Sun, 16 May 2021 16:10:43 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id C802C29018; Sun, 16 May 2021 10:10:28 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id CE8692717B for ; Sun, 16 May 2021 10:10:22 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id B035460018; Sun, 16 May 2021 10:10:22 -0400 (EDT) Received: (nullmailer pid 3516745 invoked by uid 1000); Sun, 16 May 2021 14:10:19 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 2/4] lib/thread: add common prefix to debug messages, join lines Date: Sun, 16 May 2021 11:10:13 -0300 Message-Id: <20210516141015.3516582-3-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210516141015.3516582-1-david@tethera.net> References: <20210516141015.3516582-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: BFPEISUO3MX5CHBRC2Z5AFEH55EUBYGG X-Message-ID-Hash: BFPEISUO3MX5CHBRC2Z5AFEH55EUBYGG X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621174243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wKSouK69sZz0u7crbSsZKE3nznzYBvncd6swcSo7QP0=; b=aEUZQfpcQU8zd+DHjHwRo7TpA2i/NbkTExYsTEI3F60drEwSaSUW9Y+5wz7aPAmHoTWKhN dZ74YqeaezYcQKCJrwHNMclQph7tMfl3fvCLZkLkYbgKJifwuBUnvXNbv646FhfyJ8DILu V1boinsDy6EyosilzKzTaiVcTfgX9LrUJHaMcm3K4pGA8iXEYSdZuo2sFjaWI7lrWW0C/p Xxb84+m0XEbA1t0ojfwOtGlHyxHaw7XNAe7Lel8IYF2WLQqp8lkSBaERZ5bLOtwLnctz6p kJXDaOcyKFrBY3pXROH+DIqRFGhHBxu2KKu6uB7fWtBrxTqRXcjVwKtpk95BPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621174243; a=rsa-sha256; cv=none; b=QN5tVFF5y+egHH/PZQWWwpx8WVLLykzsrPOJj9CDhRB0V/pdfjGVEawXENNbHX+i9T1Yy2 cG5sGw2lg7ucjrfJVnNfAEM9KPEcE30Q/ZLiyWk9/bCVZ4eYgWGv0hujU2OdUHQ2TZzDqH wrceiFFRXVC++5dnMba5SvXvoLKUweUPTqfICpww759zjPX9g+ytWsAgfrQvAeE4Yw8/20 mKrOujoQ8n7M+bP4Y8dvJVc6qKkv65iY60yZ1Vjfema66kF9OSatW8kq7d3tASZHMfZKCc iBPOEjSIAfAaVYLx/e1g1wjCjbWi/s/XuZddPVRX/wTkYBnhaGWcz1mce5/hYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 84D7A11BED X-Spam-Score: 0.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: hUNrG7W+iqy7 This will simplify filtering these message, e.g. in the test suite. --- lib/thread.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/thread.cc b/lib/thread.cc index 46a50e80..5ac0db6f 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -25,7 +25,7 @@ #include /* GHashTable */ #ifdef DEBUG_THREADING -#define THREAD_DEBUG(format, ...) fprintf (stderr, format " (%s).\n", ##__VA_ARGS__, __location__) +#define THREAD_DEBUG(format, ...) fprintf (stderr, "DT: " format " (%s).\n", ##__VA_ARGS__, __location__) #else #define THREAD_DEBUG(format, ...) do {} while (0) /* ignored */ #endif @@ -400,7 +400,7 @@ _parent_via_in_reply_to (notmuch_thread_t *thread, notmuch_message_t *message) const char *in_reply_to; in_reply_to = _notmuch_message_get_in_reply_to (message); - THREAD_DEBUG ("checking message = %s in_reply_to=%s\n", + THREAD_DEBUG ("checking message = %s in_reply_to=%s", notmuch_message_get_message_id (message), in_reply_to); if (in_reply_to && (! EMPTY_STRING (in_reply_to)) && @@ -423,31 +423,31 @@ _parent_or_toplevel (notmuch_thread_t *thread, notmuch_message_t *message) const notmuch_string_list_t *references = _notmuch_message_get_references (message); - THREAD_DEBUG ("trying to reparent via references: %s\n", + THREAD_DEBUG ("trying to reparent via references: %s", notmuch_message_get_message_id (message)); for (notmuch_string_node_t *ref_node = references->head; ref_node; ref_node = ref_node->next) { - THREAD_DEBUG ("checking reference=%s\n", ref_node->string); + THREAD_DEBUG ("checking reference=%s", ref_node->string); if ((g_hash_table_lookup_extended (thread->message_hash, ref_node->string, NULL, (void **) &new_parent))) { size_t new_depth = _notmuch_message_get_thread_depth (new_parent); - THREAD_DEBUG ("got depth %lu\n", new_depth); + THREAD_DEBUG ("got depth %lu", new_depth); if (new_depth > max_depth || ! parent) { - THREAD_DEBUG ("adding at depth %lu parent=%s\n", new_depth, ref_node->string); + THREAD_DEBUG ("adding at depth %lu parent=%s", new_depth, ref_node->string); max_depth = new_depth; parent = new_parent; } } } if (parent) { - THREAD_DEBUG ("adding reply %s to parent=%s\n", + THREAD_DEBUG ("adding reply %s to parent=%s", notmuch_message_get_message_id (message), notmuch_message_get_message_id (parent)); _notmuch_message_add_reply (parent, message); } else { - THREAD_DEBUG ("adding as toplevel %s\n", + THREAD_DEBUG ("adding as toplevel %s", notmuch_message_get_message_id (message)); _notmuch_message_list_add_message (thread->toplevel_list, message); } @@ -482,13 +482,13 @@ _resolve_thread_relationships (notmuch_thread_t *thread) */ if (first_node) { message = first_node->message; - THREAD_DEBUG ("checking first message %s\n", + THREAD_DEBUG ("checking first message %s", notmuch_message_get_message_id (message)); if (_notmuch_message_list_empty (maybe_toplevel_list) || ! _parent_via_in_reply_to (thread, message)) { - THREAD_DEBUG ("adding first message as toplevel = %s\n", + THREAD_DEBUG ("adding first message as toplevel = %s", notmuch_message_get_message_id (message)); _notmuch_message_list_add_message (maybe_toplevel_list, message); } -- 2.30.2