سؤال

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