cursive

2025-11-03T16:32:54.015489Z

hey Hello

2025-11-03T16:33:22.071109Z

is there a way to setup logback printer to print with actual linebreaks and colors when logging through the REPL?

2025-11-03T16:33:34.040589Z

{:meta {:line 2, :column 1}, :trace nil, :msg "Hello world", :user-id nil, :ns-name "user", :data {:foo 42}}
=> nil

2025-11-03T16:33:48.987369Z

(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}))

2025-11-03T16:33:57.691579Z

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#))))

2025-11-03T16:34:02.476399Z

I'm using like this