duct

2018-11-22T11:23:11.125Z

@flowthing That looks like the README hasn't been updated to reflect the code. Would you mind opening an issue for it?

flowthing 2018-11-22T11:46:04.125200Z

I can make a PR.

2018-11-22T11:56:57.125400Z

Thanks

2018-11-22T14:05:14.127100Z

A newbie question. How can I use logger.timbre in handlers? I don't know how to get the initialized logger/Logger.

2018-11-22T18:36:16.127200Z

You can pass in a reference to :duct/logger

2018-11-22T18:36:58.127400Z

For example:

:app.handler/whatever
{:logger #ig/ref :duct/logger}

2018-11-22T18:37:35.127600Z

The :duct.module/logging module sets the configuration up with default logging configurations for both dev and prod.

2018-11-22T18:37:50.127800Z

In your handler itself, you'd access the logger like:

2018-11-22T18:38:42.128Z

(defmethod ig/init-key :app.handler/whatever [_ {:keys [logger]}]
  (log/log logger :info ::message))

2018-11-22T18:39:19.128200Z

Newer versions of the duct/logger library also allow for (log/info logger ::message) as a shortcut.