taoensso / timbre

Pure Clojure/Script logging library
https://www.taoensso.com/timbre
Eclipse Public License 1.0
1.44k stars 171 forks source link

`spit-appender` hard-codes "\n" #292

Closed jimpil closed 3 years ago

jimpil commented 5 years ago

Instead it can simply use system-newline from the same namespace.

On a slightly different note, it seems that spit-appender actually tries to be something like a file-line-appender. If that's the case a slightly cheaper implementation (skips two calls to str) would be the following:

(with-open [^BufferedWriter wrt (io/writer fname :append append?)]
  (let [^String out (force output_)]
    (.write wrt out)
    (.newLine wrt)))

Furthermore, extending the above to use a shared Lock is pretty trivial too (for thread-safety mentioned in another ticket).

ptaoussanis commented 3 years ago

Fixing shortly