Restore backwards compatibility with Timbre v4.x Carmine appender
This commit is contained in:
parent
460c20d21f
commit
cac9123794
1 changed files with 12 additions and 0 deletions
|
|
@ -245,6 +245,8 @@
|
||||||
(defn set-auto-freeze-compressor! [x] (alter-var-root #'*auto-freeze-compressor* (constantly x)))
|
(defn set-auto-freeze-compressor! [x] (alter-var-root #'*auto-freeze-compressor* (constantly x)))
|
||||||
(defn swap-custom-readers! [f] (alter-var-root #'*custom-readers* f))
|
(defn swap-custom-readers! [f] (alter-var-root #'*custom-readers* f))
|
||||||
|
|
||||||
|
(declare ^:dynamic *final-freeze-fallback*) ; DEPRECATED
|
||||||
|
|
||||||
;;;; Freezing
|
;;;; Freezing
|
||||||
|
|
||||||
(defprotocol Freezable
|
(defprotocol Freezable
|
||||||
|
|
@ -860,9 +862,14 @@
|
||||||
(try-write-readable out x)
|
(try-write-readable out x)
|
||||||
(write-unfreezable out x))
|
(write-unfreezable out x))
|
||||||
(ff out x))
|
(ff out x))
|
||||||
|
|
||||||
(or
|
(or
|
||||||
(try-write-serializable out x)
|
(try-write-serializable out x)
|
||||||
(try-write-readable out x)
|
(try-write-readable out x)
|
||||||
|
|
||||||
|
;; For back compatibility:
|
||||||
|
(when-let [fff *final-freeze-fallback*] (fff out x))
|
||||||
|
|
||||||
(throw-unfreezable x))))
|
(throw-unfreezable x))))
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
|
|
@ -1502,3 +1509,8 @@
|
||||||
(comment
|
(comment
|
||||||
(inspect-ba (freeze "hello"))
|
(inspect-ba (freeze "hello"))
|
||||||
(seq (:data-ba (inspect-ba (freeze "hello")))))
|
(seq (:data-ba (inspect-ba (freeze "hello")))))
|
||||||
|
|
||||||
|
;;;; Deprecated
|
||||||
|
|
||||||
|
(enc/defonce* ^:dynamic *final-freeze-fallback* "DEPRECATED" nil)
|
||||||
|
(def freeze-fallback-as-str "DEPRECATED" write-unfreezable)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue