[#188] Hotfix: regression re: interleaving println

This commit is contained in:
Peter Taoussanis 2016-08-19 09:59:53 +07:00
parent 97df46c6b3
commit 587b3e015f
1 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,12 @@
taoensso.timbre/default-err) taoensso.timbre/default-err)
#+clj (alias 'timbre 'taoensso.timbre) #+clj (alias 'timbre 'taoensso.timbre)
#+clj
(def ^:private ^:const system-newline
(System/getProperty "line.separator"))
#+clj (defn- atomic-println [x] (print (str x system-newline)) (flush))
(defn println-appender (defn println-appender
"Returns a simple `println` appender for Clojure/Script. "Returns a simple `println` appender for Clojure/Script.
Use with ClojureScript requires that `cljs.core/*print-fn*` be set. Use with ClojureScript requires that `cljs.core/*print-fn*` be set.
@ -53,7 +59,9 @@
:*err* *err* :*err* *err*
stream)] stream)]
(binding [*out* stream] (println (force output_))))))})) (binding [*out* stream]
#+clj (atomic-println (force output_))
#+cljs (println (force output_))))))}))
(comment (println-appender)) (comment (println-appender))