mirror of https://github.com/status-im/timbre.git
Use system-configured formatters, output, stacktrace printers, etc.
This commit is contained in:
parent
603584e13c
commit
581ab21687
|
@ -52,7 +52,7 @@
|
||||||
(.renameTo (io/file log) (io/file (format "%s.%03d" abs-path n)))
|
(.renameTo (io/file log) (io/file (format "%s.%03d" abs-path n)))
|
||||||
(recur more (dec n))))))
|
(recur more (dec n))))))
|
||||||
|
|
||||||
(defn appender-fn [{:keys [ap-config prefix throwable message]}]
|
(defn appender-fn [{:keys [ap-config output]}]
|
||||||
(let [{:keys [path max-size backlog]
|
(let [{:keys [path max-size backlog]
|
||||||
:or {max-size (* 1024 1024)
|
:or {max-size (* 1024 1024)
|
||||||
backlog 5}} (:rotor ap-config)]
|
backlog 5}} (:rotor ap-config)]
|
||||||
|
@ -61,9 +61,7 @@
|
||||||
(when (> (.length (io/file path)) max-size)
|
(when (> (.length (io/file path)) max-size)
|
||||||
(rotate-logs path backlog))
|
(rotate-logs path backlog))
|
||||||
(spit path
|
(spit path
|
||||||
(with-out-str
|
(str output "\n")
|
||||||
(t/str-println prefix "-" message
|
|
||||||
(t/stacktrace throwable)))
|
|
||||||
:append true)
|
:append true)
|
||||||
(catch java.io.IOException _)))))
|
(catch java.io.IOException _)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue