Expose more of the TR opt logging.

original commit: 30146b7b8c7a4bde11f5d356f6be9cbc5d46377a
This commit is contained in:
Vincent St-Amour 2011-07-21 12:04:07 -04:00
parent 5155f0310c
commit a8845e3dcb

View File

@ -6,6 +6,7 @@
(provide log-optimization log-missed-optimization
print-log clear-log
log-message-from-tr-opt?
with-intercepted-tr-logging with-tr-logging-to-port
(struct-out log-entry)
(struct-out opt-log-entry)
@ -223,16 +224,18 @@
;;--------------------------------------------------------------------
(define (log-message-from-tr-opt? l)
(let ([data (vector-ref l 2)])
(and (pair? data)
(eq? (car data) optimization-log-key))))
;; only intercepts TR log messages
(define (with-intercepted-tr-logging interceptor thunk)
(with-intercepted-logging
#:level 'warning
(lambda (l)
(let ([data (vector-ref l 2)])
;; look only for optimizer messages
(when (and (pair? data)
(eq? (car data) optimization-log-key))
(interceptor l))))
(lambda (l) ;; look only for optimizer messages
(when (log-message-from-tr-opt? l)
(interceptor l)))
thunk))
(define (with-tr-logging-to-port port thunk)