Question

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.

Was it helpful?

Solution

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"))

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top