Created
February 28, 2013 21:29
-
-
Save dyoo/5060281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (require racket/stxparam) | |
| (define verbosity-level (make-parameter 0)) | |
| (define-syntax (log stx) | |
| (syntax-case stx () | |
| ([_ num msg ...] | |
| #`(when (>= (verbosity-level) num) | |
| (apply printf (list msg ...)))))) | |
| (parameterize | |
| ([verbosity-level 1 ;;0 | |
| ]) | |
| (log 1 "test at runtime\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment