Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:tools.logging 0.2.5-SNAPSHOT
Description
The expansion of the log macros can double-evaluate the first argument.
For example, the following call:
(log/info (expensive-call foo) bar)
Expands to this:
(let*
[logger_278auto_
(get-logger logger-factory #<Namespace scratch.core>)]
(if (enabled? logger_278auto_ :info)
(if (instance? java.lang.Throwable (expensive-call foo))
(log*
logger_278auto_
:info
(expensive-call foo)
(print-str bar))
(log*
logger_278auto_
:info
nil
(print-str (expensive-call foo) bar)))))
Note the calls to "expensive-call" both in the instance check and in the log* call.
Attachments
Activity
Alexander Taggart
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Patch | Code and Test [ 10002 ] | |
| Resolution | Completed [ 1 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |