Clearer logging

This commit is contained in:
Ray Miller 2025-07-04 16:01:05 +01:00
parent 17abb6019c
commit be28e14d3e
Signed by: ray
GPG key ID: 043F786C4CD681B8

View file

@ -66,6 +66,8 @@ this program. If not, see <https://www.gnu.org/licenses/>.
(action #:init-keyword #:action #:getter task-action)
(args #:init-keyword #:args #:init-form (list) #:getter task-args)
(trigger #:init-keyword #:trigger #:init-form (list) #:getter task-trigger)
;; TODO: replace the exception handler with a continue-on-error? boolean, and construct
;; an exception handler that logs the error along with the task name
(exception-handler #:init-keyword #:exception-handler #:init-value #f #:getter task-exception-handler))
(define (task . args) (apply make <task> args))
@ -77,9 +79,9 @@ this program. If not, see <https://www.gnu.org/licenses/>.
(let ((result ((task-action task) conn)))
(cond
((equal? result #f)
(log-msg 'NOTICE (task-name task) " - no change"))
(log-msg 'NOTICE (task-name task) " - OK"))
((equal? result #t)
(log-msg 'NOTICE (task-name task) " - ok")
(log-msg 'NOTICE (task-name task) " - CHANGED")
(for-each schedule-handler! (task-trigger task)))
(else
(log-msg 'NOTICE (task-name task) " - " result))))))