|
7 | 7 | ;; remove this notice, or any other, from this software.
|
8 | 8 |
|
9 | 9 | (ns ^{:author "Alex Taggart"
|
10 |
| - :doc "Logging macros that support printing message arguments readably. |
| 10 | + :doc "Logging macros that support printing message (some) arguments as |
| 11 | + if wrapped in pr-str, the goal being to preserve their data representation |
| 12 | + distinct from the explanatory text. See logp and logf for details regarding |
| 13 | + which args are treated in this manner. |
11 | 14 |
|
12 | 15 | Examples:
|
13 | 16 |
|
|
33 | 36 |
|
34 | 37 | (defmacro logp
|
35 | 38 | "Logs a message using print style args, where message args that are not
|
36 |
| - literal strings will be printed readably. Can optionally take a throwable as |
37 |
| - its second arg. See level-specific macros, e.g., debug." |
| 39 | + literal strings will be printed readably, as if wrapped in pr-str. Can |
| 40 | + optionally take a throwable as its second arg. See level-specific macros, |
| 41 | + e.g., debug." |
38 | 42 | {:arglists '([level message & more] [level throwable message & more])}
|
39 | 43 | [level x & more]
|
40 | 44 | ; Why bind `*print-readably*` to true?
|
|
65 | 69 |
|
66 | 70 | (defmacro logf
|
67 | 71 | "Logs a message using a format string and args, where all format args will be
|
68 |
| - printed readably. Can optionally take a throwable as its second arg. See |
69 |
| - level-specific macros, e.g., debugf." |
| 72 | + printed readably, as if wrapped in pr-str. Can optionally take a throwable as |
| 73 | + its second arg. See level-specific macros, e.g., debugf." |
70 | 74 | {:arglists '([level fmt & fmt-args] [level throwable fmt & fmt-args])}
|
71 | 75 | [level x & more]
|
72 | 76 | (if (or (instance? String x) (nil? more)) ; optimize for non-exception case
|
|
0 commit comments