|
81 | 81 |
|
82 | 82 | (defmacro logp |
83 | 83 | "Logs a message using print style args. Can optionally take a throwable as its |
84 | | - second arg. See level-specific macros, e.g., debug." |
| 84 | + second arg. See level-specific macros, e.g., debug. |
| 85 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
85 | 86 | {:arglists '([level message & more] [level throwable message & more])} |
86 | 87 | [level x & more] |
87 | 88 | (if (or (instance? String x) (nil? more)) ; optimize for common case |
|
95 | 96 |
|
96 | 97 | (defmacro logf |
97 | 98 | "Logs a message using a format string and args. Can optionally take a |
98 | | - throwable as its second arg. See level-specific macros, e.g., debugf." |
| 99 | + throwable as its second arg. See level-specific macros, e.g., debugf. |
| 100 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
99 | 101 | {:arglists '([level fmt & fmt-args] [level throwable fmt & fmt-args])} |
100 | 102 | [level x & more] |
101 | 103 | (if (or (instance? String x) (nil? more)) ; optimize for common case |
|
134 | 136 |
|
135 | 137 | (defmacro spyf |
136 | 138 | "Evaluates expr and may write (format fmt result) to the log. Returns the |
137 | | - result of expr. Defaults to :debug log level." |
| 139 | + result of expr. Defaults to :debug log level. |
| 140 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
138 | 141 | ([fmt expr] |
139 | 142 | `(spyf :debug ~fmt ~expr)) |
140 | 143 | ([level fmt expr] |
|
211 | 214 | ;; level-specific macros |
212 | 215 |
|
213 | 216 | (defmacro trace |
214 | | - "Trace level logging using print-style args." |
| 217 | + "Trace level logging using print-style args. |
| 218 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
215 | 219 | {:arglists '([message & more] [throwable message & more])} |
216 | 220 | [& args] |
217 | 221 | `(logp :trace ~@args)) |
218 | 222 |
|
219 | 223 | (defmacro debug |
220 | | - "Debug level logging using print-style args." |
| 224 | + "Debug level logging using print-style args. |
| 225 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
221 | 226 | {:arglists '([message & more] [throwable message & more])} |
222 | 227 | [& args] |
223 | 228 | `(logp :debug ~@args)) |
224 | 229 |
|
225 | 230 | (defmacro info |
226 | | - "Info level logging using print-style args." |
| 231 | + "Info level logging using print-style args. |
| 232 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
227 | 233 | {:arglists '([message & more] [throwable message & more])} |
228 | 234 | [& args] |
229 | 235 | `(logp :info ~@args)) |
230 | 236 |
|
231 | 237 | (defmacro warn |
232 | | - "Warn level logging using print-style args." |
| 238 | + "Warn level logging using print-style args. |
| 239 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
233 | 240 | {:arglists '([message & more] [throwable message & more])} |
234 | 241 | [& args] |
235 | 242 | `(logp :warn ~@args)) |
236 | 243 |
|
237 | 244 | (defmacro error |
238 | | - "Error level logging using print-style args." |
| 245 | + "Error level logging using print-style args. |
| 246 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
239 | 247 | {:arglists '([message & more] [throwable message & more])} |
240 | 248 | [& args] |
241 | 249 | `(logp :error ~@args)) |
242 | 250 |
|
243 | 251 | (defmacro fatal |
244 | | - "Fatal level logging using print-style args." |
| 252 | + "Fatal level logging using print-style args. |
| 253 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
245 | 254 | {:arglists '([message & more] [throwable message & more])} |
246 | 255 | [& args] |
247 | 256 | `(logp :fatal ~@args)) |
248 | 257 |
|
249 | 258 | (defmacro tracef |
250 | | - "Trace level logging using format." |
| 259 | + "Trace level logging using format. |
| 260 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
251 | 261 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
252 | 262 | [& args] |
253 | 263 | `(logf :trace ~@args)) |
254 | 264 |
|
255 | 265 | (defmacro debugf |
256 | | - "Debug level logging using format." |
| 266 | + "Debug level logging using format. |
| 267 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
257 | 268 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
258 | 269 | [& args] |
259 | 270 | `(logf :debug ~@args)) |
260 | 271 |
|
261 | 272 | (defmacro infof |
262 | | - "Info level logging using format." |
| 273 | + "Info level logging using format. |
| 274 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
263 | 275 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
264 | 276 | [& args] |
265 | 277 | `(logf :info ~@args)) |
266 | 278 |
|
267 | 279 | (defmacro warnf |
268 | | - "Warn level logging using format." |
| 280 | + "Warn level logging using format. |
| 281 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
269 | 282 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
270 | 283 | [& args] |
271 | 284 | `(logf :warn ~@args)) |
272 | 285 |
|
273 | 286 | (defmacro errorf |
274 | | - "Error level logging using format." |
| 287 | + "Error level logging using format. |
| 288 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
275 | 289 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
276 | 290 | [& args] |
277 | 291 | `(logf :error ~@args)) |
278 | 292 |
|
279 | 293 | (defmacro fatalf |
280 | | - "Fatal level logging using format." |
| 294 | + "Fatal level logging using format. |
| 295 | + Use the 'logging.readable' namespace to avoid wrapping args in pr-str." |
281 | 296 | {:arglists '([fmt & fmt-args] [throwable fmt & fmt-args])} |
282 | 297 | [& args] |
283 | 298 | `(logf :fatal ~@args)) |
|
0 commit comments