(read-file-list #f "Read files to be processed from command line arguments")
(safe #f "Run safely")
- (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN")
-
+ (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
+ (separate-log-files #f "Output to FILE.log per file.")
(ttf-verbosity 0
"how much verbosity for TTF font embedding?")
))
(let* ((failed '())
+ (separate-logs (ly:get-option 'separate-log-files))
(start-measurements (ly:get-option 'dump-profile))
(handler (lambda (key failed-file)
(set! failed (append (list failed-file) failed)))))
(gc)
(if start-measurements
(set! start-measurements (profile-measurements)))
+
+ (if separate-logs
+ (ly:stderr-redirect (format "~a.log" (basename x ".ly")) "w"))
+
(lilypond-file handler x)
(if start-measurements
(dump-profile x start-measurements (profile-measurements)))
(ly:reset-all-fonts))))
files)
+
+ ;; we want the failed-files notice in the aggregrate logfile.
+ (if (ly:get-option 'separate-logs)
+ (ly:stderr-redirect
+ (if (string-or-symbol? (ly:get-option 'log-file))
+ (format "~a.log" (ly:get-option 'log-file))
+ "/dev/tty") "a"))
+
+
failed))
(define (lilypond-file handler file-name)