zilch-cli-ninja: Use the logger
Change-Id: I4cfcd8495d05500b14ba4c9b39726bc86a6a6964
This commit is contained in:
parent
c4ec32eac3
commit
83993d7739
1 changed files with 12 additions and 1 deletions
|
|
@ -28,7 +28,18 @@
|
||||||
|
|
||||||
(when (assoc 'help options) (print-help #f))
|
(when (assoc 'help options) (print-help #f))
|
||||||
|
|
||||||
|
;; Set up the logger.
|
||||||
|
(define (set-print-logs val) #f)
|
||||||
|
(let ((prev-error-handler (current-exception-handler))) (current-exception-handler (lambda data (set-print-logs #t) (apply prev-error-handler data))))
|
||||||
|
(when (terminal-port? (current-error-port))
|
||||||
|
(let-values (((new-out new-err statusbar-set-print-logs logger) (statusbar-logger (current-output-port) (current-error-port) (assoc 'print-build-logs options))))
|
||||||
|
(current-output-port new-out)
|
||||||
|
(current-error-port new-err)
|
||||||
|
(set! set-print-logs statusbar-set-print-logs)
|
||||||
|
(*logger* logger)))
|
||||||
|
|
||||||
(when (null? args)
|
(when (null? args)
|
||||||
|
(set-print-logs #t)
|
||||||
(print-help "No subcommand"))
|
(print-help "No subcommand"))
|
||||||
|
|
||||||
;; Flags passed to the nix daemon:
|
;; Flags passed to the nix daemon:
|
||||||
|
|
@ -70,7 +81,7 @@
|
||||||
(when (eq? (car c) 'project)
|
(when (eq? (car c) 'project)
|
||||||
(let loop ((rewrites (ninja-build-config-rewrites config)))
|
(let loop ((rewrites (ninja-build-config-rewrites config)))
|
||||||
(cond
|
(cond
|
||||||
((null? rewrites) (error "Subproject not found" (cdr c)))
|
((null? rewrites) (set-print-logs #t) (error "Subproject not found" (cdr c)))
|
||||||
((string=? (caar rewrites) (cdr c)) (set! config (cdar rewrites)))
|
((string=? (caar rewrites) (cdr c)) (set! config (cdar rewrites)))
|
||||||
(else (loop (cdr rewrites)))))))
|
(else (loop (cdr rewrites)))))))
|
||||||
options)
|
options)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue