[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 | ||
| Environment: |
tools.logging 0.2.5-SNAPSHOT |
||
| Attachments: |
|
| 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* Note the calls to "expensive-call" both in the instance check and in the log* call. |
| Comments |
| Comment by Alexander Taggart [ 04/Feb/13 10:28 PM ] |
|
Fixed in 0.2.6. |
[TLOG-11] tools.logging doesn't AOT Created: 22/Mar/13 Updated: 30/Apr/13 Resolved: 30/Apr/13 |
|
| Status: | Closed |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Allen Rohner | Assignee: | Alexander Taggart |
| Resolution: | Declined | Votes: | 0 |
| Labels: | None | ||
| Waiting On: | Allen Rohner |
| Description |
|
tools.logging does not work if used in a project that is AOT'd. To reproduce, in a project using tools.logging: lein jar I can workaround it in my project by including (when *compile-files* (compile 'clojure.tools.logging) (compile 'clojure.tools.logging.impl)) |
| Comments |
| Comment by Alexander Taggart [ 30/Apr/13 5:11 PM ] |
|
It's not clear to me what "does not work" means. I've made a quick test project: https://github.com/ataggart/aot-log-test Cloning that repo, running lein jar then lein run yields the output I would expect. Further details appreciated. |
| Comment by Allen Rohner [ 30/Apr/13 6:32 PM ] |
|
This isn't a bug; User Error. I thought I had fully isolated the bug in my app's codebase, but I forgot about an :injection that we have that jams a debug macro into clojure.core. for posterity, it was caused by doing (binding [*ns* (find-ns 'clojure.core)]
(require 'clojure.tools.logging)
(defmacro inspect
"prints the expression '<name> is <value>', and returns the value"
[value]
`(do
(let [value# (quote ~value)
result# ~value]
(println value# "is" (with-out-str (clojure.pprint/pprint result#)))
(clojure.tools.logging/infof "%s is %s" value# result#)
result#))
Moving the require call to inside the macroexpansion resolved the bug. (And yes, I'm moving to https://github.com/dgrnbrg/spyscope now that I'm aware of it) Sorry to waste your time, Alex. |
| Comment by Alexander Taggart [ 30/Apr/13 7:06 PM ] |
|
No worries. On a related note, do you see any utility in keeping the spy macro? It's pretty much what you're doing. Do you use inspect for logging or as an in-repl debugging tool? Perhaps spy makes more sense in tools.trace. |
| Comment by Allen Rohner [ 30/Apr/13 7:12 PM ] |
|
TBH, I didn't know about spy. Also, my inspect macro predates clojure.tools.logging, and might even predate clojure.contrib.logging, if you can believe that. I use inspect as a debugging tool. The main value to jamming it into clojure.core is that I can use it in any file, without having to stop and muck with the ns declaration. Therefore if I was going to use anything else, it would need to have that property. |
[TLOG-8] README.md still refers to using version 0.2.3 of tools.logging Created: 24/Nov/12 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: | Enhancement | Priority: | Trivial |
| Reporter: | Trevor Bernard | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The latest version is 0.2.4 and should reflected in the README |
| Comments |
| Comment by Alexander Taggart [ 04/Feb/13 10:27 PM ] |
|
Fixed in 0.2.6. |