mirror of https://github.com/status-im/timbre.git
Attempted auto workaround for CLJ-124
This commit is contained in:
parent
371fb24d3f
commit
6ab9c4ac59
|
@ -76,14 +76,6 @@ java.lang.Exception: Oh noes
|
|||
<...>
|
||||
```
|
||||
|
||||
### Timbre slowing down your Clojure app shutdown?
|
||||
|
||||
This is due to an outstanding [issue](http://dev.clojure.org/jira/browse/CLJ-124) in Clojure. As a workaround, add the following to your application's startup routine:
|
||||
|
||||
```clojure
|
||||
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (shutdown-agents))))
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
This is the biggest win over Java logging IMO. Here's `timbre/example-config` (also Timbre's default config):
|
||||
|
|
|
@ -555,3 +555,10 @@
|
|||
[probability & body]
|
||||
`(do (assert (<= 0 ~probability 1) "Probability: 0 <= p <= 1")
|
||||
(when (< (rand) ~probability) ~@body)))
|
||||
|
||||
;;;; Shutdown hook ; Workaround for http://dev.clojure.org/jira/browse/CLJ-124
|
||||
|
||||
#+clj
|
||||
(defonce ^:private shutdown-hook
|
||||
(.addShutdownHook (Runtime/getRuntime)
|
||||
(Thread. (fn [] (shutdown-agents)))))
|
||||
|
|
Loading…
Reference in New Issue