Re: Change var in other namespace

2012-11-13 Thread himangshu
this reply was god sent to me. I use tomcat and war to deploy my clojure code. the default thing was just not compiling. Although I do not have slf4j in my classpath. find logger was still giving slf4j and when it encountered first logging statement, the code used to crap out saying class not f

Re: Change var in other namespace

2011-11-18 Thread Sean Corfield
On Fri, Nov 18, 2011 at 6:35 AM, vitalyper wrote: > IMO, clojure.tools.logging could of made this easier: log > implementation from classpath by default with override by client when > needed. I agree but when I brought the issue up, there didn't seem to be much support for making it easier... Per

Re: Change var in other namespace

2011-11-18 Thread vitalyper
Thanks, Sean. Exactly what I was looking for. IMO, clojure.tools.logging could of made this easier: log implementation from classpath by default with override by client when needed. On Nov 17, 11:32 pm, Sean Corfield wrote: > Note: if you just want something that will execute at startup and > for

Re: Change var in other namespace

2011-11-17 Thread Sean Corfield
Note: if you just want something that will execute at startup and force _all_ logging to use log4j, instead of wrapping code in (binding ..) then you probably want something like this: (ns your.namespace (:require [clojure.tools.logging :as log]) (:require [clojure.tools.logging.impl :as impl]

Re: Change var in other namespace

2011-11-17 Thread Mark Rathwell
You rebind dynamic vars with binding, so your use would look something like this: (binding [*logger-factory* (log-impl/log4j-factory)] (do-stuff-with-the-logger-factory-rebound)) On Thu, Nov 17, 2011 at 5:17 PM, vitalyper wrote: > clojure.tools.logging defines *logger-factory* and initializes

Change var in other namespace

2011-11-17 Thread vitalyper
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." :dynam