2

When I run following simple program, it takes one minute until finish after print "after info" message.

$ lein run -m logger.core

(ns logger.core
  (:require [taoensso.timbre :as timbre]))

(defn -main []
  (println "before info")
  (timbre/info "hello world")
  (println "after info"))

If I comment out (timbre/info "hello world"), that waste of time disappears completely.

What is the reason? How can I avoid from this situation?

Thanks in advance.

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
snufkon
  • 301
  • 4
  • 8

2 Answers2

6

You need to shutdown agents.

(ns logger.core
  (:require [taoensso.timbre :as timbre]))

(defn -main []
  (println "before info")
  (timbre/info "hello world")
  (shutdown-agents)
  (println "after info"))
KobbyPemson
  • 2,519
  • 1
  • 18
  • 33
-1

Because most likely Leiningen is also compiling Timbre library and all of its dependencies.

Chiron
  • 20,081
  • 17
  • 81
  • 133