0

Trying to get Timbre to load in my test project along with clojure.test. My first attempt is

(ns foo.core-test
  (:require [clojure.test :refer :all]
            [taoensso.timbre :as timbre]
            [foo.core :refer :all]))

which compiles until I follow the next step in the Timbre documentation, adding

(timbre/refer-timbre) ; Provides useful Timbre aliases in this ns

I now get the following compile error

IllegalStateException report already refers to #'clojure.test/report in namespace foo.core-test
clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)

ok, groovy, I'll try

(ns foo.core-test ; ------vvvvvvvvvvvvvvvv-----
  (:require [clojure.test :exclude [report]]
            [taoensso.timbre :as timbre]
            [foo.core :refer :all]))

mmmm, nope. I notice that clojure has a report, too. How about

(ns foo.core-test
  (:refer-clojure :exclude [report])
  (:require [clojure.test :refer :all]
            [taoensso.timbre :as timbre]
            [foo.core :refer :all]))

mmmmm, nope.

I hacked around for a while till I got tired of combinatorial trial-and-error. I haven't found a way to make them coexist. Any clues, please & thanks?

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
Reb.Cabin
  • 5,426
  • 3
  • 35
  • 64

1 Answers1

1

There's no report in clojure.core. In your second ns form you seem to be missing :refer :all for clojure.test. Try the following form:

(ns foo.core-test
  (:require [clojure.test :refer :all :exclude [report]]
            [taoensso.timbre :as timbre]
            [foo.core :refer :all]))
zoldar
  • 221
  • 1
  • 5
  • That definitely did not work :( one of the many permutations I tried. – Reb.Cabin Apr 28 '14 at 12:22
  • 1
    **EDIT**: restarting nrepl made this solution work. Some bogusly saved state in the nrepl fooled me by keeping the error state bogusly alive. – Reb.Cabin Apr 28 '14 at 12:28