Back

*config* (clj)

(source)

declaration

Examples

timbre
(ns taoensso.timbre-tests
  (:require
   [clojure.test    :as test :refer [deftest testing is]]
   [taoensso.encore :as enc]
   [taoensso.timbre :as timbre])

(defmacro log-data
  "Executes an easily-configured log call and returns ?data sent to test appender."
  [ns level m-config m-appender args]
  `(let [appender# (apn ~m-appender)]
     (binding [timbre/*config*
               (conj timbre/default-config ~m-config
                 {:appenders {:test-appender appender#}})]
ogri-la/strongbox
(ns strongbox.logging-test
  (:require
   [clojure.test :refer [deftest testing is use-fixtures]]
   [strongbox
    [logging :as logging]
    [core :as core]]
   [taoensso.timbre :as timbre]
   [strongbox.test-helper :as helper :refer [with-running-app fixture-path]]))

(deftest log-level-while-testing
  (testing "the log level is set to `:debug` while testing"
    (is (= :debug (-> timbre/*config* :min-level)))))

(deftest log-level-while-running-app
  (testing "the default log level is *always* set to `:debug` while testing, even when running an app"
    (with-running-app
      (is (not (= logging/default-log-level (-> timbre/*config* :min-level))))
      (is (= :debug (-> timbre/*config* :min-level))))))

(deftest changing-log-level-while-testing
  (let [current-log-level #(-> timbre/*config* :min-level)]
    (testing "it is possible to change the log level while testing"
      (core/set-log-level! :warn)
      (is (= :warn (current-log-level))))
fmind/euphony
(ns euphony.utils.log
  (:require [taoensso.timbre :as log]))

(defmacro with-level [level & body]
  `(binding [log/*config* (assoc log/*config* :level ~level)]
     ~@body))
posobin/ampie
(ns ampie.logging
  (:require [taoensso.timbre :as log]))

#_(when (= "Google Inc." js/navigator.vendor)
    (set! log/*config*
      (-> log/*config*
        (assoc-in [:appenders :console] devtools-appender))))