Pass log struct along with the log messages.

original commit: 7f3bb5d0173d22733f49ec0b5187ab433bc0d264
This commit is contained in:
Vincent St-Amour 2011-06-23 14:06:06 -04:00
parent 3f2009c651
commit 629feb81bf

View File

@ -62,7 +62,7 @@
(and (> badness 1) badness))))
missed-optimizations-log)
(for-each (lambda (x) (log-message logger 'warning (log-entry-msg x)
optimization-log-key))
(cons optimization-log-key x)))
(sort (remove-duplicates log-so-far)
(match-lambda*
[(list (log-entry msg-x stx-x pos-x)
@ -193,8 +193,10 @@
(define (with-tr-logging-to-port port thunk)
(with-intercepted-logging ; catch opt logs
(lambda (l)
(when (eq? (vector-ref l 2) ; look only for optimizer messages
optimization-log-key)
(displayln (vector-ref l 1) port))) ; print log message
(let ([data (vector-ref l 2)])
;; look only for optimizer messages
(when (and (pair? data)
(eq? (car data) optimization-log-key))
(displayln (vector-ref l 1) port)))) ; print log message
thunk
#:level 'warning))