pedestal

polymeris 2020-06-20T02:08:17.255600Z

Want to output JSON instead of edn form pedestal.log... is there a way to globally override :io.pedestal.log/formatter?

1πŸ‘
2020-06-23T19:59:52.266400Z

@souenzzo It’s worth considering. Perhaps open an issue capturing the desire?

souenzzo 2020-06-25T01:18:32.266600Z

https://github.com/pedestal/pedestal/issues/666

1πŸ”₯2πŸ‘Ί1🀘16️⃣
souenzzo 2020-06-25T01:19:50.267300Z

if you like the idea i can create a PR

2020-06-25T16:43:53.267600Z

Thanks, will look into it further tomorrow

polymeris 2020-06-26T15:46:29.268800Z

Thanks, @souenzzo!

polymeris 2020-06-20T02:08:38.255700Z

I've created wrapper macros, but that doesn't seem very nice:

(def formatter json/encode)

(defmacro trace [& keyvals] `(pedestal-log/trace ::pedestal-log/formatter formatter ~@keyvals))
(defmacro debug [& keyvals] `(pedestal-log/debug ::pedestal-log/formatter formatter ~@keyvals))
(defmacro info [& keyvals] `(pedestal-log/info ::pedestal-log/formatter formatter ~@keyvals))
(defmacro warn [& keyvals] `(pedestal-log/warn ::pedestal-log/formatter formatter ~@keyvals))
(defmacro error [& keyvals] `(pedestal-log/error ::pedestal-log/formatter formatter ~@keyvals))