mirror of https://github.com/status-im/timbre.git
Add `logged-future`
This commit is contained in:
parent
6c359427d9
commit
9454e0f4ab
|
@ -367,8 +367,11 @@
|
||||||
(defmacro log-and-rethrow-errors
|
(defmacro log-and-rethrow-errors
|
||||||
[& body] `(try ~@body (catch Exception e# (error e#) (throw e#))))
|
[& body] `(try ~@body (catch Exception e# (error e#) (throw e#))))
|
||||||
|
|
||||||
|
(defmacro logged-future [& body] `(future (log-errors ~@body)))
|
||||||
|
|
||||||
(comment (log-errors (/ 0))
|
(comment (log-errors (/ 0))
|
||||||
(log-and-rethrow-errors (/ 0)))
|
(log-and-rethrow-errors (/ 0))
|
||||||
|
(logged-future (/ 0)))
|
||||||
|
|
||||||
;;;; Dev/tests
|
;;;; Dev/tests
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue