Makes logging unified

This commit is contained in:
2023-10-30 12:35:18 -07:00
parent f0a7c378f7
commit 930b900849
44 changed files with 485 additions and 555 deletions

View File

@@ -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

View File

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