Use timbre to surpress logs

In test and exercises (property test) timbre is now used as a dependency
to help surpress logging. It will only log fatal log outputs.

Timbre is not a dependency when packaging the final library jar so as
not to specify any logging for consumers of the library.
Signed-off-by: Snorre Magnus Davøen's avatarSnorre Magnus Davøen <snorre.davoen@nsd.no>
parent 8973c285
......@@ -11,11 +11,13 @@
:sha "028a6d41ac9ac5d5c405dfc38e4da6b4cc1255d5"}
org.clojure/test.check {:mvn/version "0.9.0"}
clj-time {:mvn/version "0.14.4"}
clojure-term-colors {:mvn/version "0.1.0"}}
clojure-term-colors {:mvn/version "0.1.0"}
com.taoensso/timbre {:mvn/version "4.1.0"}}
:main-opts ["-m cognitect.test-runner"]}
:propertytest {:extra-deps {org.clojure/test.check {:mvn/version "0.9.0"}
clj-time {:mvn/version "0.14.4"}
clojure-term-colors {:mvn/version "0.1.0"}}
clojure-term-colors {:mvn/version "0.1.0"}
com.taoensso/timbre {:mvn/version "4.1.0"}}
:extra-paths ["test" "test-resources"]
:main-opts ["-m exerciser"]}
:jar {:extra-deps {luchiniatwork/cambada {:mvn/version "1.0.0"}}
......
......@@ -9,8 +9,14 @@
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
[clojure.spec.gen.alpha :as gen]
[taoensso.timbre :as timbre]
[taoensso.timbre.tools.logging :as cljlog]
[clojure.term.colors :refer :all]))
;; Effectively turn of logging in exercises
(def timbre-config {:level :fatal})
(timbre/merge-config! timbre-config)
(cljlog/use-timbre)
(def private-rsa-key
"-----BEGIN RSA PRIVATE KEY-----
......@@ -45,9 +51,7 @@ vLu9XxKFHYlWPccluz3pqDfaGNPO12968DAldwvAV6hTGgx7oMaNPu0UltgD/aaj
(def sample-claims {:sub "f750bd26-ae85-4808-8f9a-dcc964fc8664"
:exp (time/plus (time/now) (time/minutes 30))})
(def untestable-funs ['no.nsd.clj-jwt/fetch-keys
'no.nsd.clj-jwt/resolve-key
'no.nsd.clj-jwt/unsign])
(def untestable-funs ['no.nsd.clj-jwt/fetch-keys])
(defn generate-jwt
[claims key]
......
......@@ -3,9 +3,16 @@
[buddy.sign.jwt :as buddy-jwt]
[buddy.core.keys.jwk.proto :as buddy-jwk]
[buddy.core.keys :as buddy-keys]
[taoensso.timbre :as timbre]
[taoensso.timbre.tools.logging :as cljlog]
[clojure.java.io :refer [resource]]
[clojure.test :refer [deftest testing is]]))
;; Effectively turn of logging in test
(def timbre-config {:level :fatal})
(timbre/merge-config! timbre-config)
(cljlog/use-timbre)
(def example-jwt "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment