Expose log-events-and-actions?.

This commit is contained in:
Tony Garnock-Jones 2013-10-30 16:59:32 +00:00
parent 9379661e06
commit 853f3b2f6c
1 changed files with 6 additions and 4 deletions

View File

@ -25,10 +25,12 @@
spawn-world
deliver-event
transition-bind
sequence-transitions)
sequence-transitions
log-events-and-actions?)
(define pid-stack (make-parameter '()))
(define log-events-and-actions? #f)
(define log-events-and-actions? (make-parameter #f))
(struct route (subscription? pattern meta-level level) #:prefab)
@ -121,7 +123,7 @@
(define (deliver-event e pid p)
(parameterize ((pid-stack (cons pid (pid-stack))))
(when (and log-events-and-actions? e)
(when (and (log-events-and-actions?) e)
(log-info "~a: ~v --> ~v ~v"
(reverse (pid-stack))
e
@ -145,7 +147,7 @@
[#f w]
[(transition new-state new-actions)
(let* ((w (transform-process pid w (lambda (p)
(when (and log-events-and-actions?
(when (and (log-events-and-actions?)
(not (null? (flatten new-actions))))
(log-info "~a: ~v <-- ~v ~v"
(reverse (cons pid (pid-stack)))