Search code examples
clojureleiningentimbre

Timbre(Clojure), it takes one minute to finish


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.


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