clojure.tools.logging defines *logger-factory* and initializes it with
first logger implementation on the class path
(def ^{:doc
"An instance satisfying the impl/LoggerFactory protocol. Used
internally to
obtain an impl/Logger. Defaults to the value returned from impl/
find-factory."
:dynamic true}
*logger-factory*
(impl/find-factory))
In my own namespace I want to redefine *logger-factory* to log4j one.
Tried different variations (def, set!, etc) in 1.3.0 with no avail.
(ns my.foo
(:gen-class)
(:use
[clojure.tools.logging :only (*logger-factory* info debug)])
(:require
[clojure.string :as s1]
[clojure.tools.logging.impl :as log-impl])
)
(defn init-logging
"Force log4j factory for core tools logging"
[]
(def *logger-factory* (log-impl/log4j-factory)))
; CompilerException java.lang.IllegalStateException: *logger-factory*
already refers to: #'clojure.tools.logging/*logger-factory* in
namespace: infrared.common
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en