Skip to content

Commit

Permalink
[#188] Hotfix: regression re: interleaving println
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Aug 23, 2016
1 parent 97df46c commit 587b3e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/taoensso/timbre/appenders/core.cljx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
taoensso.timbre/default-err)
#+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
"Returns a simple `println` appender for Clojure/Script.
Use with ClojureScript requires that `cljs.core/*print-fn*` be set.
Expand Down Expand Up @@ -53,7 +59,9 @@
:*err* *err*
stream)]

(binding [*out* stream] (println (force output_))))))}))
(binding [*out* stream]
#+clj (atomic-println (force output_))
#+cljs (println (force output_))))))}))

(comment (println-appender))

Expand Down

0 comments on commit 587b3e0

Please sign in to comment.