Expose more of the TR opt logging.
This commit is contained in:
parent
73140544ce
commit
30146b7b8c
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(provide log-optimization log-missed-optimization
|
(provide log-optimization log-missed-optimization
|
||||||
print-log clear-log
|
print-log clear-log
|
||||||
|
log-message-from-tr-opt?
|
||||||
with-intercepted-tr-logging with-tr-logging-to-port
|
with-intercepted-tr-logging with-tr-logging-to-port
|
||||||
(struct-out log-entry)
|
(struct-out log-entry)
|
||||||
(struct-out opt-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
|
;; only intercepts TR log messages
|
||||||
(define (with-intercepted-tr-logging interceptor thunk)
|
(define (with-intercepted-tr-logging interceptor thunk)
|
||||||
(with-intercepted-logging
|
(with-intercepted-logging
|
||||||
#:level 'warning
|
#:level 'warning
|
||||||
(lambda (l)
|
(lambda (l) ;; look only for optimizer messages
|
||||||
(let ([data (vector-ref l 2)])
|
(when (log-message-from-tr-opt? l)
|
||||||
;; look only for optimizer messages
|
(interceptor l)))
|
||||||
(when (and (pair? data)
|
|
||||||
(eq? (car data) optimization-log-key))
|
|
||||||
(interceptor l))))
|
|
||||||
thunk))
|
thunk))
|
||||||
|
|
||||||
(define (with-tr-logging-to-port port thunk)
|
(define (with-tr-logging-to-port port thunk)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user