[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-12] Reflection Warnings when using tools.logging Created: 30/Apr/13 Updated: 30/Apr/13 |
|
| Status: | Open |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Trevor Bernard | Assignee: | Alexander Taggart |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Waiting On: | Trevor Bernard |
| Description |
|
A few of my projects are still reflecting using tools.logging 0.2.6 and slf4j-log4j12 "1.7.2". lein check produces the following output: ... |
| Comments |
| Comment by Alexander Taggart [ 30/Apr/13 5:37 PM ] |
|
I've made a quick test project: https://github.com/ataggart/reflect-log-test Cloning that repo, running lein check yields no reflection warnings. Please provide a way for me to reproduce what you see. |
| Comment by Trevor Bernard [ 30/Apr/13 5:46 PM ] |
|
Forking that project and will try to find a simple test case that reproduces it. |
[TLOG-7] Reflection warnings Created: 16/Apr/12 Updated: 24/Apr/13 Resolved: 05/May/12 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Sean Corfield | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Reflection warning, clojure/tools/logging.clj:270 - reference to field isTraceEnabled can't be resolved. |
| Comments |
| Comment by Alexander Taggart [ 05/May/12 3:26 PM ] |
|
Adds type-hints to all implementation-wrapping fns. |
| Comment by Trevor Bernard [ 23/Apr/13 4:39 PM ] |
|
A few of my projects are still reflecting using tools.logging 0.2.6 and slf4j-log4j12 "1.7.2". I've attached a patch that I've started using to fix this issue. |
| Comment by Trevor Bernard [ 23/Apr/13 4:41 PM ] |
|
I'm a registered contributor to clojure. |
| Comment by Andy Fingerhut [ 24/Apr/13 12:33 PM ] |
|
Trevor, since this ticket was already closed and marked as completed some time ago, it is probably best to create a new ticket and attach your patch to that. I know the issue is similar to this existing ticket, but best to have new tickets for new work. |
[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-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. |
[TLOG-9] spy macro (or new spy macro) that accepts a message Created: 08/Dec/12 Updated: 08/Dec/12 |
|
| Status: | Open |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Dave Sann | Assignee: | Alexander Taggart |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I think it might be useful to have spy be able to take a message to be logged in addition to the data. (or have a similar macro showing an optional message instead of the code). (spy "doing x" (blah)) with spy this may conflict with the log-level. I find this sort of function with a message useful and use it quite often. Much more often than plain logging. Generally - I would't log the code unless it logged file and line number too. |
[TLOG-6] tools.logging does not log to stdout when run from swank-clojure Created: 07/Feb/12 Updated: 07/Feb/12 Resolved: 07/Feb/12 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Trevor Bernard | Assignee: | Alexander Taggart |
| Resolution: | Declined | Votes: | 0 |
| Labels: | None | ||
| Environment: |
tools.logging "0.2.3", Mac OS X Lion, emacs 23.4, swank-clojure 1.3.4, slime 20100404 |
||
| Description |
|
Trying to evaluate (info "Hello, World!") doesn't print to stdout when evaluating from within emacs. It works if I `lein run` however. |
| Comments |
| Comment by Trevor Bernard [ 07/Feb/12 8:44 PM ] |
|
It works when I use the inferior-lisp process but not in slime |
| Comment by Alexander Taggart [ 07/Feb/12 9:07 PM ] |
|
Configuring swank/slime to work with wherever your log implementation writes its output is not a tools.logging issue. |
[TLOG-5] Improvement of sample code in README.md Created: 14/Oct/11 Updated: 17/Oct/11 Resolved: 17/Oct/11 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Jingguo Yao | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
README.md uses the following code to show the usage of tools.logging. (ns example.core (:use [clojure.tools.logging :only (info error)])) (defn divide [one two] (try (info "Calculated" (/ one two)) (catch Exception ex (error ex "There was an error in calculation")))) If log4j.rootLogger in the given log4j.properties is updated to "ERROR, A1". "(divide 10 0)" won't evaluate "(error ex "There was an error in calculation")". The reason is that INFO logging level is lower than ERROR logging level. So the info macro will not evaluate "(/ one two)" since the specific INFO logging level is not in effect. New tools.logging users often expect "(divide 10 0)" to produce logging with ERROR level. They are confused with the above behaviour. So I suggest to make some change to the sample code. Maybe the following code: (ns example.core (:use [clojure.tools.logging :only (info error)])) (defn divide [one two] (try (info "Calculating" one two) (/ one two) (catch Exception ex (error ex "There was an error in calculation")))) |
[TLOG-4] Provided implementations of logging protocols fail. Created: 29/Sep/11 Updated: 29/Sep/11 Resolved: 29/Sep/11 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Blocker |
| Reporter: | Alexander Taggart | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
Example of error when trying to call a Logger protocol function: java.lang.IllegalArgumentException: No implementation of method: :enabled? of protocol: #'clojure.tools.logging.impl/Logger found for class: org.apache.log4j.Logger The bug is the result of combining syntax-quoting with extend-type, e.g.: `(do
(extend-type org.apache.commons.logging.Log
Logger
(enabled? [logger# level#] ... )))
The syntax-quote turns the above enabled? into clojure.tools.logging/enabled? protocol function name, and then the extend-type turns that into the keyword :clojure.tools.logging/enabled?, which does not match the expected :enabled?. Attached patch fixes this by using extend maps rather than extend-type. Also adds some tests. |
| Comments |
| Comment by Alexander Taggart [ 29/Sep/11 3:36 PM ] |
|
Committed: https://github.com/clojure/tools.logging/commit/f9cb0a7232d3a11cb7e74e4c13c3adc054e7e7a2 |
[TLOG-3] Move implementation-specific details out of main ns Created: 06/Jul/11 Updated: 07/Jul/11 Resolved: 07/Jul/11 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Major |
| Reporter: | Alexander Taggart | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code and Test |
| Approval: | Ok |
| Description |
|
The protocols which allow the main functions/macros to adapt to implementation specific logging libraries do not need to be in the clojure.tools.logging namespace since they are not intended to be used by consumers. Plan:
|
| Comments |
| Comment by Alexander Taggart [ 07/Jul/11 6:49 PM ] |
|
https://github.com/clojure/tools.logging/commit/42dfba84a373e52a4e80af6467e47761e6f20678 |
[TLOG-2] Change "log" semantics to "logger" semantics Created: 05/Jul/11 Updated: 06/Jul/11 Resolved: 06/Jul/11 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Laurent Petit | Assignee: | Laurent Petit |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code and Test |
| Approval: | Ok |
| Description |
|
The relevant patch is named tools.logging- Changes "log" semantics to "logger" semantics. Log protocol becomes LoggerProtocol |
| Comments |
| Comment by Alexander Taggart [ 06/Jul/11 3:00 PM ] |
|
Committed to master: |
[TLOG-1] Non-optimized, no-exception path for logp calls log* with wrong arity Created: 01/Jun/11 Updated: 01/Jun/11 Resolved: 01/Jun/11 |
|
| Status: | Resolved |
| Project: | tools.logging |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Alexander Taggart | Assignee: | Alexander Taggart |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
Per Laurent Petit |
| Comments |
| Comment by Alexander Taggart [ 01/Jun/11 11:34 AM ] |
|
https://github.com/clojure/tools.logging/commit/687c1833c59ad1204c2a41cf0ed1f53be4a0fa8d |