Skip to content

Commit ce24970

Browse files
committed
Avoid reflection
1 parent 2b5fd38 commit ce24970

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/com/kroo/typeset/logback/JsonLayout.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Simple JSON layout component for Logback Classic, with Clojure and SLF4J 2+
33
key value attribute support."
44
(:require [jsonista.core :as j])
5-
(:import (ch.qos.logback.classic.spi ILoggingEvent ThrowableProxy ThrowableProxyUtil)
5+
(:import (ch.qos.logback.classic.spi ILoggingEvent IThrowableProxy ThrowableProxy ThrowableProxyUtil)
66
(ch.qos.logback.core CoreConstants)
77
(java.time Instant)
88
(java.util HashMap List Map Map$Entry)
@@ -97,9 +97,9 @@
9797
(if t
9898
(recur (conj! acc (ex-data t)) (.getCause t))
9999
(persistent! acc)))]
100-
(if (every? nil? ex-datas)
101-
nil
102-
ex-datas))
100+
(if (every? nil? ex-datas)
101+
nil
102+
ex-datas))
103103
(ex-data t)))
104104

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

0 commit comments

Comments
 (0)