From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +M1MFb9TmmIykAAAbAwnHQ (envelope-from ) for ; Fri, 03 Jun 2022 20:32:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cOAcFb9TmmIKbQEAauVa8A (envelope-from ) for ; Fri, 03 Jun 2022 20:32:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 110391AD5F for ; Fri, 3 Jun 2022 20:32:29 +0200 (CEST) Received: from localhost ([::1]:42196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxC5z-0003hw-Kb for larch@yhetil.org; Fri, 03 Jun 2022 14:32:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxC5w-0003fq-Jz for gwl-devel@gnu.org; Fri, 03 Jun 2022 14:32:24 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:38068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxC5u-0007RQ-5X for gwl-devel@gnu.org; Fri, 03 Jun 2022 14:32:23 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 253IW5b6027869 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 3 Jun 2022 14:32:14 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 253IW5b6027869 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1654281135; bh=dUA4gpBZkMNGGmhIMPIJEOAuithZeN3r26/iupDluew=; h=From:To:Cc:Subject:Date:From; b=qpzSO5tN16uiYrttqbatmLpJ/Yv/GM9V3dhJ+X62ZFaEY2jOADO7VwoKYATBXIRKA nQVlayBNk85a85XhJzdmdI/+7W2FhG9W+Xh/gf58AnOBU6MzraYcRA/NjI8hDSMocr BqZygI72AsmlxwvPBqm+GXwmZa3FzY/qp2qo0G9s= From: Olivier Dion To: gwl-devel@gnu.org Cc: Olivier Dion Subject: [PATCH] gwl/ui: Check for log-events configuration Date: Fri, 3 Jun 2022 14:32:03 -0400 Message-Id: <20220603183203.11092-1-olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Fri, 3 Jun 2022 18:32:05 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654281149; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=dUA4gpBZkMNGGmhIMPIJEOAuithZeN3r26/iupDluew=; b=VhucJqynm4B31zjW4UBa+tY/WGytUL7+HCDztDQtGc1oD3S2vNjqm7r2STwbNliIHstzE4 0ajt/6xT1sBp7ZeWrULyiWSS/NPKBO2vV8yxTMHyTt2+3ug2Lc0O/8K74tNYIMPIQuQu4S 4Ovw8dIDIzMnjhfjEmYyESWCHPqjm6MvZUvRaSTPTb0LEjQ5GS926al8LCS4EZnc6xSlr7 Q8W8iFvEVwecwg39YqpVcEf2TeUvbERlPHaiNGgX+dqv1TrYTB0wUIx4AIYhdtKLKRmyGd lXdebKthPZ9ukkFmA92+qCvqrGMMDdtu1OueDb7G9l/ABv6A9mpSbfaKArmVAw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654281149; a=rsa-sha256; cv=none; b=iBPVNtSbkxs3e0qMOhfNJJyc+6Lt25RXLonfcHy2BfUKK8u/t3QVPIf7KgH/G4QThOYKei mYzROdB0mTa/USOR9dBZdhf7BtaxB1RO8VDTvD8ykn+qdVM/Ztu7u4WYRvctaiEDSmJLpO DPuT8ueIDNSydl3GkAHNxkFZntRGp+CU74NnkPxE6FsWA2X4HInVxLm69BA4sgDexUHBYH QSL4cwvVY2sc7/rL0Ik+bWDoILo79Wyc9Nzxk5g//m1gCwOvyhz5sOfvbkR4x2U+ZPJEQ9 tvjWP3uLTaXNlpU4oEt2jA6hJT2vPH5iPEPvxq2a4+VPKABnLTN9LaAsYUfqqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b=qpzSO5tN; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.02 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=polymtl.ca header.s=default header.b=qpzSO5tN; dmarc=pass (policy=quarantine) header.from=polymtl.ca; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 110391AD5F X-Spam-Score: -6.02 X-Migadu-Scanner: scn0.migadu.com X-TUID: rG87LhXK8V0I Some GWL sub-commands such as `graph' do not accept a log event configuration. This results in returning `#f' from `(%config 'log-events)' Fix this by checking that 'log-events was configured. --- gwl/ui.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gwl/ui.scm b/gwl/ui.scm index 35bd127..92cf451 100644 --- a/gwl/ui.scm +++ b/gwl/ui.scm @@ -65,8 +65,10 @@ (define (log-event type . message) (define print? - (or (member 'all (%config 'log-events)) - (member type (%config 'log-events)))) + (let ((log-events (%config 'log-events))) + (and log-events + (or (member 'all (%config 'log-events)) + (member type (%config 'log-events)))))) (when print? (case type ((error) -- 2.36.1