This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-22
Channels
- # 100-days-of-code (1)
- # adventofcode (21)
- # announcements (2)
- # beginners (44)
- # calva (1)
- # cider (2)
- # cljdoc (16)
- # cljs-dev (70)
- # cljsrn (29)
- # clojure (66)
- # clojure-austria (1)
- # clojure-europe (4)
- # clojure-finland (1)
- # clojure-hamburg (1)
- # clojure-italy (24)
- # clojure-nl (3)
- # clojure-uk (127)
- # clojurescript (30)
- # core-typed (3)
- # cursive (34)
- # data-science (2)
- # datomic (16)
- # duct (17)
- # editors (1)
- # emacs (4)
- # figwheel-main (4)
- # fulcro (40)
- # hoplon (2)
- # instaparse (5)
- # kaocha (4)
- # leiningen (1)
- # luminus (4)
- # nrepl (46)
- # off-topic (5)
- # onyx (2)
- # other-languages (55)
- # parinfer (3)
- # protorepl (4)
- # re-frame (33)
- # reagent (6)
- # reitit (13)
- # ring-swagger (5)
- # shadow-cljs (26)
- # spacemacs (4)
- # sql (8)
- # testing (27)
- # tools-deps (21)
- # yada (1)
@flowthing That looks like the README hasn't been updated to reflect the code. Would you mind opening an issue for it?
Thanks
A newbie question. How can I use logger.timbre
in handlers? I don't know how to get the initialized logger/Logger
.
You can pass in a reference to :duct/logger
For example:
:app.handler/whatever
{:logger #ig/ref :duct/logger}
The :duct.module/logging
module sets the configuration up with default logging configurations for both dev and prod.
In your handler itself, you'd access the logger like:
(defmethod ig/init-key :app.handler/whatever [_ {:keys [logger]}]
(log/log logger :info ::message))
Newer versions of the duct/logger library also allow for (log/info logger ::message)
as a shortcut.
If I want to use logger in ig/halt-key
, then return {:server server :logger logger}
is the way?
In Integrant 0.8.0-alpha2 I've added a resolve-key
multimethod that might be useful if you just want to use the server in references.
Though it's still experimental functionality.