 ;; and now that some of the not relevant stuff
 ;; have been moved out is a bit cleaner,
 ;; but still not clear enough...
-;; NEED NORE clean loop
+;; NEED CLEANER loop
 ;;
 (defn siphon [{:keys [kafka-source elasticsearch-target]}]
   (loop [consumer (connect-to-kafka kafka-source)

    (log/set-config! [:shared-appender-config :rotor] appender-config)))


(defn valid-config? [c]
  (let [errors (s/check config-schema c)]
    (if (empty? errors)
      c
      (log/warn "The configuration file has invalid values/structure : " errors))))


(defn parse-opt-errors->str [errors]
  (str "There was an error in the command line : \n" (clojure.string/join \newline errors)))


(defn- init-tracking!
  "Initialises the metrics tracking system"
  [{enabled :enabled :as cfg}]
  ;; TODO: remove this when done with changes
  (trackit/start-reporting! {:type :console :reporting-frequency-seconds 30})
  (when enabled
    (log/info "Sending metrics to:" cfg)
