From a359e93544ce9285dd6d2c188c30293124b20fe4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 8 May 2022 13:48:27 +0200 Subject: Hide debug output behind `verbose` config option Don't print any output by default. --- src/config.lisp | 7 ++++++- src/main.lisp | 12 +++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/config.lisp b/src/config.lisp index b1093b6..ecee3de 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -18,12 +18,17 @@ :initarg :sendmail :reader sendmail :documentation "Email sending client command") - (email-to :initarg :email-to :reader email-to :documentation "Email recipient") + (verbose + :initarg :verbose + :initform nil + :reader verbose + :documentation "Turn on verbose output") + (jql :initarg :jql :reader jql diff --git a/src/main.lisp b/src/main.lisp index 3b6da43..2ac7daf 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -36,10 +36,11 @@ (total (gethash "total" response))) - (format t "start-at: ~A max-results: ~A total: ~A~%" - start-at - max-results - total) + (when (verbose config) + (format t "start-at: ~A max-results: ~A total: ~A~%" + start-at + max-results + total)) ;; Watch each issue. ; (loop for issue @@ -85,7 +86,8 @@ (defun watch-issue (config issue &key basic-auth-token) ;; 1. Watch issue in Jira ;; 2. Send email - (format t "Watching issue ~A~%" (gethash "key" issue)) + (when (verbose config) + (format t "Watching issue ~A~%" (gethash "key" issue))) (add-watcher (endpoint config) -- cgit v1.2.3