logging.scm 550 B

1234567891011121314151617181920212223
  1. (library (logging)
  2. (export debug)
  3. (import
  4. (except (rnrs base) let-values)
  5. (only (guile)
  6. lambda* λ)))
  7. (define displayln
  8. (lambda* (#:key (output-port (current-output-port)) (form "a") (verbose #t) . msgs)
  9. (when verbose
  10. (display (string-append
  11. (string-join
  12. (map (lambda (msg)
  13. (simple-format #f (string-append "~" form) msg))
  14. msgs)
  15. " ") "\n")
  16. output-port))))
  17. ;; alias for displayln
  18. (define debug displayln)