Clojure-Contrib

Default log namespace is incorrect

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Currently the runtime value of ns is used to namespace calls to log, instead of the ns of the code that calls log. For example:

user=> (ns foo (:use (clojure.contrib logging))) 
nil
foo=> (defn bar [] (log :fatal "in foo/bar")) 
#'foo/bar
foo=> (bar)
#<Agent@4f961bac...>
foo=> (ns baz (:use (clojure.contrib logging)))
nil
baz=>  (foo/bar) 
#<Agent@4f961bac...></code></pre>
and the output to the log is:
<pre><code>2009-08-06 11:05:19,817 FATAL foo - / - in foo/bar
2009-08-06 11:05:38,167 FATAL baz - / - in foo/bar

The second printed namespace is "baz" and it should be the same as the first, "foo".

Activity

Hide
Assembla Importer added a comment -

ataggart said: [file:cnaHiKGR4r3RZOeJe5afGb]: Patch to fix log namespacing

Show
Assembla Importer added a comment - ataggart said: [file:cnaHiKGR4r3RZOeJe5afGb]: Patch to fix log namespacing
Hide
Assembla Importer added a comment -

tomfaulhaber said: (In revision:90f7ea1dec4e7c835cf3a7f98e67c4e02d7d0f64) Fixes #11; log-ns is now captured at macro-expansion-time.

Branch: master

Show
Assembla Importer added a comment - tomfaulhaber said: (In revision:90f7ea1dec4e7c835cf3a7f98e67c4e02d7d0f64) Fixes #11; log-ns is now captured at macro-expansion-time. Branch: master

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: