aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-05-08 13:48:27 +0200
committerTeddy Wing2022-05-08 13:48:27 +0200
commita359e93544ce9285dd6d2c188c30293124b20fe4 (patch)
treedc79e827118adb96ba5e76bf9878c3ba35c476dd
parent243c4bc8093992164a12892b29172b3a5127c820 (diff)
downloadwajir-a359e93544ce9285dd6d2c188c30293124b20fe4.tar.bz2
Hide debug output behind `verbose` config option
Don't print any output by default.
-rw-r--r--src/config.lisp7
-rw-r--r--src/main.lisp12
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)