logging.scm 664 B

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