Skip to content

Commit

Permalink
[nop] Update Pretty dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Feb 22, 2024
1 parent f42b9b8 commit b757786
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
:test-paths ["test" #_"src"]

:dependencies
[[com.taoensso/encore "3.81.0"]
[io.aviso/pretty "1.4.4"]]
[[com.taoensso/encore "3.81.0"]
[org.clj-commons/pretty "2.2.1"]]

:profiles
{;; :default [:base :system :user :provided :dev]
Expand Down
30 changes: 12 additions & 18 deletions src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[taoensso.encore :as enc :refer [have have?]]
[taoensso.timbre.appenders.core :as core-appenders]

#?(:clj [io.aviso.exception :as aviso-ex])
#?(:cljs [goog.i18n.DateTimeFormat :as dtf]))
#?(:clj [clj-commons.format.exceptions :as fmt-ex])
#?(:cljs [goog.i18n.DateTimeFormat :as dtf]))

#?(:cljs (:require-macros [taoensso.timbre])))

Expand Down Expand Up @@ -489,19 +489,21 @@

#?(:clj
(def ^:private default-stacktrace-fonts
(enc/get-env {:as :edn}
(enc/get-env
{:as :edn
:default clj-commons.format.exceptions/default-fonts}
[:taoensso.timbre.default-stacktrace-fonts<.edn> ; Undocumented
:timbre-defaut-stacktrace-fonts<.edn> ; Legacy
:timbre-defaut-stacktrace-fonts<.edn> ; Legacy
])))

(defn default-output-error-fn
"Default (fn [data]) -> string, used by `default-output-fn` to
generate output for `:?err` value in log data.
For Clj:
Uses `io.aviso/pretty` to return an attractive stacktrace.
Uses `org.clj-commons/pretty` to return an attractive stacktrace.
Options:
:stacktrace-fonts ; See `io.aviso.exception/*fonts*`
:stacktrace-fonts ; See `clj-commons.format.exceptions/*fonts*`
For Cljs:
Returns simple stacktrace string."
Expand All @@ -522,18 +524,10 @@
(assoc data :?err c))))))

:clj
(let [stacktrace-fonts ; nil->{}
(if-let [e (find output-opts :stacktrace-fonts)]
(let [st-fonts (val e)]
(if (nil? st-fonts)
{}
st-fonts))
default-stacktrace-fonts)]

(if-let [fonts stacktrace-fonts]
(binding [aviso-ex/*fonts* fonts]
(do (aviso-ex/format-exception err)))
(do (aviso-ex/format-exception err)))))))
(binding [fmt-ex/*fonts*
(get output-opts :stacktrace-fonts
default-stacktrace-fonts)]
(fmt-ex/format-exception err)))))

(comment
(default-output-error-fn
Expand Down
9 changes: 4 additions & 5 deletions src/taoensso/timbre/appenders/postal.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
Requires <https://github.com/drewr/postal>."
{:author "Peter Taoussanis (@ptaoussanis)"}
(:require
[clojure.string :as str]
[taoensso.encore :as enc :refer [have have?]]
[taoensso.timbre :as timbre]
[io.aviso.exception :as aviso-ex]
[postal.core :as postal]))
[clojure.string :as str]
[taoensso.encore :as enc :refer [have have?]]
[taoensso.timbre :as timbre]
[postal.core :as postal]))

(defn default-subject-fn
"Given an `output-str`, returns an appropriate email subject string:
Expand Down

0 comments on commit b757786

Please sign in to comment.