Hi,
On 18 Apr., 09:43, MohanR <[email protected]> wrote:
> user>( defn logtrace[message]( ; <- paren?
> (let [logger (org.apache.log4j.LogManager/getLogger "Stream")](
> .log logger org.apache.log4j.Level/FATAL message
> )
> )) ; <- paren?
> )
You don't say what the exception is, but I suspect a NPE. If it is an
NPE, it most likely comes from these parens, because (.log) probably
returns nil and you finally try to call nil as a function.
Disclaimer: Don't get the following wrong. I know you are a newbie. It
is meant as a honest advice. YMMV.
You should consider a different style of indentation. It really helps
to spot these issues. Compare:
(defn logtrace
[message]
((let [logger (org.apache.log4j.LogManager/getLogger "Stream")]
(.log logger org.apache.log4j.Level/FATAL message))))
With this layout you can easily spot the two parens in front of the
let, which is almost always not what you want.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en