Creates a PrintStream that will output to the log. End-users should not need
to invoke this.
(defn log-stream
"Creates a PrintStream that will output to the log. End-users should not need
to invoke this."
[level log-ns]
(java.io.PrintStream.
(proxy [java.io.ByteArrayOutputStream] []
(flush []
(proxy-super flush)
(let [s (.trim (.toString ^java.io.ByteArrayOutputStream this))]
(proxy-super reset)
(if (> (.length s) 0)
(log level s nil log-ns)))))
true))
Comments top
No comments for log-stream. Log in to add a comment.