This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-13
Channels
- # beginners (18)
- # calva (6)
- # cider (9)
- # clara (1)
- # cljdoc (14)
- # clojure (25)
- # clojure-boston (4)
- # clojure-brasil (3)
- # clojure-czech (2)
- # clojure-italy (2)
- # clojure-sweden (6)
- # clojurescript (6)
- # cursive (6)
- # data-science (4)
- # datomic (2)
- # emacs (5)
- # fulcro (2)
- # kaocha (4)
- # off-topic (2)
- # other-languages (1)
- # pathom (5)
- # precept (1)
- # reagent (2)
- # reitit (1)
- # shadow-cljs (2)
- # spacemacs (49)
- # tools-deps (13)
- # vim (14)
- # xtdb (4)
@i see this discussion: https://clojureverse.org/t/how-do-you-personally-do-logging/4299/3
if you use tools.logging you should know which logging implementation you're using and configured (e.g. via log4j.properties when using log4j)
Does it make sense that one of the purposes of c.t.l is to allow one of multiple underlying logging implementations to be used, as stated early in its README? If yes, then as you have asked your question, the answer seems to be "the underlying logging implementation that a particular person chose to configure it with in their application".
The first two sentences of c.t.l's README: "Logging macros which delegate to a specific logging implementation. At runtime a specific implementation is selected from, in order, slf4j, Apache commons-logging, log4j2, log4j, and finally java.util.logging."
Is your question: "After I use c.t.l., how can I at run-time determine which underlying impl. c.t.l. selected?"
@i I would suggest adding the following deps to your project:
org.clojure/tools.logging {:mvn/version "0.4.1"}
ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
org.slf4j/slf4j-api {:mvn/version "1.7.26"}
optionally add:
org.slf4j/log4j-over-slf4j {:mvn/version "1.7.26"}
If you find any transient dependencies on log4j in your project.Log level can be set via logback.xml (https://logback.qos.ch/manual/configuration.html)
I have a project.clj
with a :repl-options {:init (load-file "some_file.clj")}
in it and when I run lein repl
in the project, I get java.lang.RuntimeException: Unable to resolve symbol: do in this context
. I’ve tried with some_file.clj
itself being empty, so it’s not some code in the file and lein repl
only works if I comment out this :repl-options
. If it makes a difference I have Leiningen 2.8.1 on Java 1.8.0_192 and the project is on Clojure 1.9.0. What am I doing wrong?
I just tried that with a brand new lein project, and was able to successfully run code from some_file.clj
with just a sample (println "Got here")
in it, and nothing else, both with Leiningen 2.8.1 and 2.9.1.
Try that on your system, perhaps, to see if it works with a bare-bones Leininge project?
If that doesn't work, then I would suggest checking your $HOME/.lein/profiles.clj file, perhaps renaming it temporarily in case anything in there is causing troubles.
Yeah, it is easy to forget about, and has effects cross-projects.
This was actually for http://clojuredocs.org. Took at stab at updating it to Clojure 1.10.1 and noticed you had actually added that issue 🙂
Thanks for working on it!