Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) update clj-parent to latest, avoid expensive logging #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

:min-lein-version "2.9.1"

:parent-project {:coords [puppetlabs/clj-parent "7.3.1"]
:parent-project {:coords [puppetlabs/clj-parent "7.3.20"]
:inherit [:managed-dependencies]}

:pedantic? :abort

:exclusions [org.clojure/clojure]

:dependencies [[org.clojure/clojure]
[org.clojure/tools.logging]
[prismatic/schema]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@
events :- [Event]]
(let [callbacks @(:callbacks watcher)
events-by-dir (group-by :watched-path events)]
(doseq [[dir events'] events-by-dir]
(log/debug (trs "Got {0} event(s) in directory {1}"
(count events') dir)))
(log/tracef "%s\n%s"
(trs "Events:")
(ks/pprint-to-string events))
;; avoid doing a potentially expensive walk when we aren't logging at :debug
(when (log/enabled? :debug)
(doseq [[dir events'] events-by-dir]
(log/debug (trs "Got {0} event(s) in directory {1}"
(count events') dir))))
;; avoid doing a potentially expensive print-to-string when we aren't logging at :trace
(when (log/enabled? :trace)
(log/tracef "%s\n%s"
(trs "Events:")
(ks/pprint-to-string events)))
(doseq [callback callbacks]
(callback events))))

Expand Down
Loading