hey Hello
is there a way to setup logback printer to print with actual linebreaks and colors when logging through the REPL?
{:meta {:line 2, :column 1}, :trace nil, :msg "Hello world", :user-id nil, :ns-name "user", :data {:foo 42}}
=> nil(defn pprint-log [data]
(tap> (with-out-str
(println "────────────── LOG ──────────────")
(puget/render-out (puget/canonical-printer) data)
(println "─────────────────────────────────")))
data)
(when REPL?
(defonce LEVEL_MAP
{:trace pprint-log
:debug pprint-log
:info pprint-log
:warn pprint-log
:error pprint-log}))
REPL?
`(let [d# ~(first data)]
(~lvl#
(cond-> {:msg ~message
:meta (select-keys ~metadata# [:name :file :line :column :fn-name :ns-name])
:ns-name ~(str *ns*)
:trace (context/get-log-trace)
:user-id (context/get-user-id)}
(some? d#) (assoc :data d#))))
I'm using like this