-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kepler16/jv/change-xuvwwommnokk
Replace timbre with System.Logger
- Loading branch information
Showing
8 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(ns k16.mallard.log | ||
(:import | ||
[java.lang System System$Logger System$Logger$Level])) | ||
|
||
(set! *warn-on-reflection* true) | ||
|
||
(defn get-logger ^System$Logger [name] | ||
(System/getLogger name)) | ||
|
||
(defmacro info [message] | ||
`(let [logger# (get-logger (str ~*ns*))] | ||
(.log logger# System$Logger$Level/INFO ~message))) | ||
|
||
(defn -log-error | ||
([^System$Logger logger ^String msg] | ||
(.log logger System$Logger$Level/ERROR msg)) | ||
([^System$Logger logger ^String msg ^Throwable ex] | ||
(.log logger System$Logger$Level/ERROR msg ex))) | ||
|
||
(defmacro error | ||
([message] | ||
`(-log-error (get-logger (str ~*ns*)) ~message)) | ||
([message ex] | ||
`(-log-error (get-logger (str ~*ns*)) ~message ~ex))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters