change compiler/cm so that the default logs the messages to

a logger named compiler/cm
This commit is contained in:
Robby Findler 2013-03-14 15:25:23 -05:00
parent 3f6232bc2d
commit 3b0d2f16da
2 changed files with 17 additions and 5 deletions

View File

@ -20,7 +20,7 @@
manager-skip-file-handler
file-stamp-in-collection
file-stamp-in-paths
(rename-out [trace manager-trace-handler])
manager-trace-handler
get-file-sha1
get-compiled-file-sha1
with-compile-output
@ -29,8 +29,13 @@
make-compile-lock
compile-lock->parallel-lock-client)
(define cm-logger (make-logger 'compiler/cm (current-logger)))
(define (default-manager-trace-handler str)
(when (log-level? cm-logger 'debug)
(log-message cm-logger 'debug str (current-inexact-milliseconds))))
(define manager-compile-notify-handler (make-parameter void))
(define trace (make-parameter void))
(define manager-trace-handler (make-parameter default-manager-trace-handler))
(define indent (make-parameter ""))
(define trust-existing-zos (make-parameter #f))
(define manager-skip-file-handler (make-parameter (λ (x) #f)))
@ -131,8 +136,10 @@
(reroot-path base root)]))
(define (trace-printf fmt . args)
(let ([t (trace)])
(unless (eq? t void)
(let ([t (manager-trace-handler)])
(unless (or (eq? t void)
(and (equal? t default-manager-trace-handler)
(not (log-level? cm-logger 'debug))))
(t (string-append (indent) (apply format fmt args))))))
(define (get-deps code path)

View File

@ -319,7 +319,12 @@ compilation starts. The argument to the procedure is the file's path.}
A parameter for a procedure of one argument that is called to report
compilation-manager actions, such as checking a file. The argument to
the procedure is a string.}
the procedure is a string.
The default value of the parameter logs the argument, along with
@racket[current-inexact-milliseconds] to, a logger named @racket['compiler/cm]
at the @racket['debug] level.
}
@defparam[manager-skip-file-handler proc (-> path? (or/c (cons/c number? promise?) #f))]{