Makes logging unified
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
[clojure.data.csv :as csv]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.string :as str]
|
||||
[clojure.tools.logging :as log]))
|
||||
[auto-ap.logging :as alog]))
|
||||
|
||||
(defn determine
|
||||
[[header]]
|
||||
(log/info "Importing with header" header)
|
||||
(alog/info ::importing :header header)
|
||||
(let [csv-type (cond (str/includes? (second header) "Customer's PO No.")
|
||||
:mama-lus
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
:else
|
||||
nil)]
|
||||
(log/info "csv type was determined to be" csv-type)
|
||||
(alog/info ::csv-type-determined :type csv-type)
|
||||
csv-type))
|
||||
|
||||
(defmulti parse-csv
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[clj-time.core :as time]
|
||||
[clj-time.format :as f]
|
||||
[clojure.string :as str]
|
||||
[clojure.tools.logging :as log]))
|
||||
[auto-ap.logging :as alog]))
|
||||
|
||||
(defmulti parse-value (fn [method _ _]
|
||||
method))
|
||||
@@ -46,7 +46,7 @@
|
||||
(reduced (time/from-time-zone (f/parse (f/formatter format) value)
|
||||
(time/time-zone-for-id "America/Los_Angeles")))
|
||||
(catch Exception e
|
||||
(log/warn e)
|
||||
(alog/warn ::cant-parse-date :error e :raw-value (str value))
|
||||
nil)))
|
||||
nil
|
||||
format)
|
||||
|
||||
Reference in New Issue
Block a user