문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top