<< Back to previous view

[TLOG-16] Add ClojureScript support? Created: 21/Jul/16  Updated: 21/Jul/16

Status: Open
Project: tools.logging
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Daniel Compton Assignee: Alexander Taggart
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It would be really neat if there was a unified Clojure/ClojureScript logging library. I'm thinking it would have the same API as the Clojure one. I'm not 100% sure how appenders would work though. Would a patch for this be considered?






[TLOG-20] log/info removes quotes from strings making debugging harder than it needs to be. Created: 19/Jul/17  Updated: 28/Aug/17

Status: Open
Project: tools.logging
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Lonnie Souder Assignee: Alexander Taggart
Resolution: Unresolved Votes: 1
Labels: None

Attachments: Text File TLOG20.patch    

 Description   

log/info removes quotes from strings making debugging harder than it needs to be. I found that {:test1 "", :test2 "2"} is logged as {:test1 , :test2 2}. I see the same issue when I print a map using println. prn prints the map with the quotes which is better for debugging.

I will make a patch and add it later.



 Comments   
Comment by Lonnie Souder [ 23/Jul/17 7:31 AM ]

Retested with 0.4.0

clojure.tools.logging
user=> (log/info ["test" "1" "" "3"])
Jul 23, 2017 8:22:56 AM user invoke
INFO: [test 1  3]
user=> (log/info ":one" :one 1 "1")
Jul 23, 2017 8:35:30 AM user invoke
INFO: :one :one 1 1

Output should be:

INFO: ["test" "1" "" "3"]

and

INFO: [":one" :one 1 "1"]
Comment by Lonnie Souder [ 23/Jul/17 8:04 AM ]

Replace print-str with prn-str so user can see what will be evaluated. This is useful in debugging programs but I can see how this may mess up human readable info output out there in the wild.

Comment by Juan A. Ruz [ 28/Aug/17 11:23 AM ]

Hi guys, I could avoid this annoying problem adding overwriting print-method for String type in my app code ... is it a convenient approach?

(defmethod clojure.core/print-method String
     [s ^java.io.Writer writer]
  (.write writer (str "\"" s "\"")))




Generated at Tue Sep 26 02:25:20 CDT 2017 using JIRA 4.4#649-r158309.