change compiler/cm so that the default logs the messages to
a logger named compiler/cm
This commit is contained in:
parent
3f6232bc2d
commit
3b0d2f16da
|
@ -20,7 +20,7 @@
|
||||||
manager-skip-file-handler
|
manager-skip-file-handler
|
||||||
file-stamp-in-collection
|
file-stamp-in-collection
|
||||||
file-stamp-in-paths
|
file-stamp-in-paths
|
||||||
(rename-out [trace manager-trace-handler])
|
manager-trace-handler
|
||||||
get-file-sha1
|
get-file-sha1
|
||||||
get-compiled-file-sha1
|
get-compiled-file-sha1
|
||||||
with-compile-output
|
with-compile-output
|
||||||
|
@ -29,8 +29,13 @@
|
||||||
make-compile-lock
|
make-compile-lock
|
||||||
compile-lock->parallel-lock-client)
|
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 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 indent (make-parameter ""))
|
||||||
(define trust-existing-zos (make-parameter #f))
|
(define trust-existing-zos (make-parameter #f))
|
||||||
(define manager-skip-file-handler (make-parameter (λ (x) #f)))
|
(define manager-skip-file-handler (make-parameter (λ (x) #f)))
|
||||||
|
@ -131,8 +136,10 @@
|
||||||
(reroot-path base root)]))
|
(reroot-path base root)]))
|
||||||
|
|
||||||
(define (trace-printf fmt . args)
|
(define (trace-printf fmt . args)
|
||||||
(let ([t (trace)])
|
(let ([t (manager-trace-handler)])
|
||||||
(unless (eq? t void)
|
(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))))))
|
(t (string-append (indent) (apply format fmt args))))))
|
||||||
|
|
||||||
(define (get-deps code path)
|
(define (get-deps code path)
|
||||||
|
|
|
@ -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
|
A parameter for a procedure of one argument that is called to report
|
||||||
compilation-manager actions, such as checking a file. The argument to
|
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))]{
|
@defparam[manager-skip-file-handler proc (-> path? (or/c (cons/c number? promise?) #f))]{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user