<commit_before>(ns ^:no-doc onyx.static.logging-configuration
  (:require [com.stuartsierra.component :as component]
            [taoensso.timbre :refer [info] :as timbre]
            [taoensso.timbre.appenders.3rd-party.rotor :as rotor]))

(def MAX-LOG-SIZE (* 512 102400))
(def MAX-LOG-FILES 5)

(defrecord LoggingConfiguration [file config]
  component/Lifecycle

  (start [component]
    (if config
      (timbre/merge-config! config)
      (let [rotor-appender (rotor/rotor-appender
                             {:path file
                              :max-size MAX-LOG-SIZE
                              :backlog MAX-LOG-FILES})
            rotor-appender (assoc rotor-appender
                                  :min-level :info)]
        (timbre/merge-config!
          {:appenders
           {:rotor rotor-appender}})))

    (info "Starting Logging Configuration")
    component)

  (stop [component]
    (info "Stopping Logging Configuration")
    component))

(defn logging-configuration [{:keys [onyx.log/file onyx.log/config]}]
  (map->LoggingConfiguration {:file (or file "onyx.log") :config config}))
<commit_msg>Re-add :standard-out appender which has been renamed to :println in timbre 4. Fixes #248<commit_after>(ns ^:no-doc onyx.static.logging-configuration
  (:require [com.stuartsierra.component :as component]
            [taoensso.timbre :refer [info] :as timbre]
            [taoensso.timbre.appenders.3rd-party.rotor :as rotor]))

(def MAX-LOG-SIZE (* 512 102400))
(def MAX-LOG-FILES 5)

(defrecord LoggingConfiguration [file config]
  component/Lifecycle

  (start [component]
    (if config
      (timbre/merge-config! config)
      (let [rotor-appender (rotor/rotor-appender
                             {:path file
                              :max-size MAX-LOG-SIZE
                              :backlog MAX-LOG-FILES})
            rotor-appender (assoc rotor-appender
                                  :min-level :info)]
        (timbre/merge-config!
          {:appenders
           {:println
            {:min-level :error
             :enabled? true}
            :rotor rotor-appender}})))

    (info "Starting Logging Configuration")
    component)

  (stop [component]
    (info "Stopping Logging Configuration")
    component))

(defn logging-configuration [{:keys [onyx.log/file onyx.log/config]}]
  (map->LoggingConfiguration {:file (or file "onyx.log") :config config}))

{'fraction_non_alphanumeric': 0.12013256006628004, 'fraction_numerical': 0.010770505385252692, 'mean_word_length': 2.160994764397906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1999413', 'n_tokens_mistral': 770, 'n_tokens_neox': 722, 'n_words': 168}