Clearer logging
This commit is contained in:
parent
17abb6019c
commit
be28e14d3e
1 changed files with 4 additions and 2 deletions
|
@ -66,6 +66,8 @@ this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
(action #:init-keyword #:action #:getter task-action)
|
(action #:init-keyword #:action #:getter task-action)
|
||||||
(args #:init-keyword #:args #:init-form (list) #:getter task-args)
|
(args #:init-keyword #:args #:init-form (list) #:getter task-args)
|
||||||
(trigger #:init-keyword #:trigger #:init-form (list) #:getter task-trigger)
|
(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))
|
(exception-handler #:init-keyword #:exception-handler #:init-value #f #:getter task-exception-handler))
|
||||||
|
|
||||||
(define (task . args) (apply make <task> args))
|
(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)))
|
(let ((result ((task-action task) conn)))
|
||||||
(cond
|
(cond
|
||||||
((equal? result #f)
|
((equal? result #f)
|
||||||
(log-msg 'NOTICE (task-name task) " - no change"))
|
(log-msg 'NOTICE (task-name task) " - OK"))
|
||||||
((equal? result #t)
|
((equal? result #t)
|
||||||
(log-msg 'NOTICE (task-name task) " - ok")
|
(log-msg 'NOTICE (task-name task) " - CHANGED")
|
||||||
(for-each schedule-handler! (task-trigger task)))
|
(for-each schedule-handler! (task-trigger task)))
|
||||||
(else
|
(else
|
||||||
(log-msg 'NOTICE (task-name task) " - " result))))))
|
(log-msg 'NOTICE (task-name task) " - " result))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue