unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
* [PATCH] gwl/ui: Check for log-events configuration
@ 2022-06-03 18:32 Olivier Dion
  2022-06-04 15:00 ` Ricardo Wurmus
  2022-06-06 19:48 ` [PATCH 1/3] " Olivier Dion
  0 siblings, 2 replies; 12+ messages in thread
From: Olivier Dion @ 2022-06-03 18:32 UTC (permalink / raw)
  To: gwl-devel; +Cc: Olivier Dion

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



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-06-12  9:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 18:32 [PATCH] gwl/ui: Check for log-events configuration Olivier Dion
2022-06-04 15:00 ` Ricardo Wurmus
2022-06-04 15:10   ` Olivier Dion via
2022-06-06 10:32     ` Ricardo Wurmus
2022-06-06 13:25       ` Olivier Dion via
2022-06-06 18:51         ` Olivier Dion via
2022-06-06 19:48 ` [PATCH 1/3] " Olivier Dion
2022-06-06 19:48   ` [PATCH 2/3] gwl/config: Share log-event switch with subcommands Olivier Dion
2022-06-12  9:03     ` Ricardo Wurmus
2022-06-06 19:49   ` [PATCH 3/3] graph: Add output switch Olivier Dion
2022-06-12  9:05     ` Ricardo Wurmus
2022-06-12  9:08   ` [PATCH 1/3] gwl/ui: Check for log-events configuration Ricardo Wurmus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).