proper logging, incl overfull lines (fixes #23)

main
Matthew Butterick 6 years ago
parent 5f0dd4e0f2
commit 85752e9cde

@ -0,0 +1,13 @@
#lang debug racket
(require racket/logging)
(provide (all-defined-out) with-logging-to-port)
;; creates `quadwriter-logger` and associated functions:
;; log-quadwriter-fatal, log-quadwriter-error, log-quadwriter-warning,
;; log-quadwriter-info, and log-quadwriter-debug
(define-logger quadwriter)
(define-syntax-rule (time-log NAME EXPR)
(let-values ([(res ms real-ms gc) (time-apply (λ () EXPR) null)])
(log-quadwriter-info (format "~a: ~ams" 'NAME real-ms))
(car res)))

@ -23,7 +23,8 @@
(define debug-y-margin (make-parameter 40))
(define debug-column-count (make-parameter 2))
(define debug-column-gap (make-parameter 36))
(define zoom-factor (make-parameter 1.5)))]
(define zoom-factor (make-parameter 1.5))
(define log-clipping? (make-parameter 'warn)))]
[_
#'(begin
(provide (all-defined-out))
@ -43,6 +44,7 @@
(define debug-y-margin (make-parameter #f))
(define debug-column-count (make-parameter #f))
(define debug-column-gap (make-parameter #f))
(define zoom-factor (make-parameter 1)))]))
(define zoom-factor (make-parameter 1))
(define log-clipping? (make-parameter 'warn)))]))
(go)

@ -42,7 +42,7 @@
(apply append
(for/list ([q (in-list qs)])
(match (quad-ref q :hyphenate)
[(or #false "false") (list q)]
[#false (list q)]
[_ (for*/list ([str (in-list (quad-elems q))]
[hyphen-char (in-value #\u00AD)]
[hstr (in-value (hyphenate str hyphen-char

Loading…
Cancel
Save