How to log which is the Pretty print like pprint by clojure.tools.logging? -


i using org.clojure/tools.logging. want function can pretty print log, can't find it. example, content want print is

{:status 401,  :headers {"content-type" "application/octet-stream"},  :body {:error "you don't login."}} 

but call function name info,i this

{:status 401, :headers {content-type application/octet-stream}, :body {:error don't login.}} 

how this:

(require '[clojure.pprint :as pprint])  (defn pformat [& args]         (with-out-str           (apply pprint/pprint args))) 

then:

(require '[clojure.tools.logging :as log])  (log/info (pformat {:status 401,                     :headers {"content-type" "application/octet-stream"},                     :body {:error "you don't login."}})) 

which outputs this:

apr 29, 2015 9:43:40 user invoke info: {:headers {"content-type" "application/octet-stream"},  :status 401,  :body {:error "you don't login."}} 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -