I have a feeling that there is a better way to pass log config as implicit argument or implicit context without a global var. Perhaps, I'm being unreasonable, considering that logging itself is not a pure operation that shouldn't do I/O.
On Sunday, July 26, 2015 at 1:21:14 AM UTC+9, Shantanu Kumar wrote: > > Logging calls are far too frequent to practically pass config as argument > everywhere, hence some kind of shared implicit context is required. Which > logging libraries are you dealing with? If you use Timbre[1], you can pass > config using dynamic vars or altering global state. If you use Logback[2] > or Log4j[3], you can set system properties using Java interop ahead of > dynamically loading (by looking up ns/var entry points in) Clojure code. > > [1] Timbre: https://github.com/ptaoussanis/timbre > [2] Logback: http://logback.qos.ch/ > [3] Log4j: http://logging.apache.org/log4j/2.x/ > > Shantanu > > On Saturday, 25 July 2015 20:20:55 UTC+5:30, crocket wrote: >> >> Logging libraries seem to rely on a global config. This looks like a >> dangerous state that could blow up. >> I researched a little, and there seems to be reader monad and dependency >> injection, all of which feel awkard. >> >> Is there not a decent approach to passing log config without a global var? >> > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.