<< Back to previous view

[TLOG-4] Provided implementations of logging protocols fail. Created: 29/Sep/11  Updated: 07/Jun/14  Resolved: 29/Sep/11

Status: Closed
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: Text File fix-broken-extend.patch    
Patch: Code and Test


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.:

   (extend-type org.apache.commons.logging.Log
     (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.

Comment by Alexander Taggart [ 29/Sep/11 3:36 PM ]



Generated at Fri Jan 19 15:50:23 CST 2018 using JIRA 4.4#649-r158309.