<< Back to previous view

[TLOG-10] Double-evaluation of arguments Created: 04/Feb/13  Updated: 04/Feb/13  Resolved: 04/Feb/13

Status: Closed
Project: tools.logging
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Perkins Assignee: Alexander Taggart
Resolution: Completed Votes: 0
Labels: None

tools.logging 0.2.5-SNAPSHOT

Attachments: File double-eval.diff    


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:

(get-logger logger-factory #<Namespace scratch.core>)]
(if (enabled? logger_278auto_ :info)
(if (instance? java.lang.Throwable (expensive-call foo))
(expensive-call foo)
(print-str bar))
(print-str (expensive-call foo) bar)))))

Note the calls to "expensive-call" both in the instance check and in the log* call.

Comment by Alexander Taggart [ 04/Feb/13 10:28 PM ]

Fixed in 0.2.6.

Generated at Thu Oct 08 15:09:28 CDT 2015 using JIRA 4.4#649-r158309.