Skip to content

Commit

Permalink
Avoid reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
axvr committed Jul 23, 2023
1 parent 2b5fd38 commit ce24970
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/com/kroo/typeset/logback/JsonLayout.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Simple JSON layout component for Logback Classic, with Clojure and SLF4J 2+
key value attribute support."
(:require [jsonista.core :as j])
(:import (ch.qos.logback.classic.spi ILoggingEvent ThrowableProxy ThrowableProxyUtil)
(:import (ch.qos.logback.classic.spi ILoggingEvent IThrowableProxy ThrowableProxy ThrowableProxyUtil)
(ch.qos.logback.core CoreConstants)
(java.time Instant)
(java.util HashMap List Map Map$Entry)
Expand Down Expand Up @@ -97,9 +97,9 @@
(if t
(recur (conj! acc (ex-data t)) (.getCause t))
(persistent! acc)))]
(if (every? nil? ex-datas)
nil
ex-datas))
(if (every? nil? ex-datas)
nil
ex-datas))
(ex-data t)))

(defn- log-typeset-error
Expand Down Expand Up @@ -156,8 +156,8 @@
(when-not (.isEmpty markers)
;; TODO: markers vs. tags?
(.put m "markers" (mapv #(.getName ^Marker %) markers)))))
(when-let [tp (and (:include-exception opts)
(.getThrowableProxy event))]
(when-let [^IThrowableProxy tp (and (:include-exception opts)
(.getThrowableProxy event))]
(when-let [exd (and (:include-ex-data opts)
(not (.isCyclic tp))
(instance? ThrowableProxy tp)
Expand Down

0 comments on commit ce24970

Please sign in to comment.