Makes logging unified
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
[auto-ap.graphql.utils :refer [assert-admin assert-can-see-client]]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[auto-ap.yodlee.core2 :as yodlee]
|
||||
[clojure.tools.logging :as log]
|
||||
[auto-ap.logging :as alog]
|
||||
[config.core :refer [env]]
|
||||
[datomic.api :as dc]))
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
:url (:yodlee2-fastlink env)}) }))
|
||||
(defn refresh-provider-accounts [{:keys [identity edn-params]}]
|
||||
(assert-admin identity)
|
||||
(log/info "refreshing " edn-params)
|
||||
(alog/info ::refreshing :params edn-params)
|
||||
(try
|
||||
(yodlee/refresh-provider-account (-> (:client-id edn-params)
|
||||
Long/parseLong
|
||||
@@ -36,7 +36,7 @@
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body "{}" }
|
||||
(catch Exception e
|
||||
(log/error e)
|
||||
(alog/error ::error :error e)
|
||||
{:status 400
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
@@ -45,7 +45,9 @@
|
||||
(defn get-provider-account-detail [{:keys [identity]
|
||||
{:keys [client id]} :route-params}]
|
||||
(assert-admin identity)
|
||||
(log/info "looking-up " client id)
|
||||
(alog/info ::looking-up
|
||||
:client client
|
||||
:id id)
|
||||
(try
|
||||
|
||||
{:status 200
|
||||
@@ -56,7 +58,7 @@
|
||||
:client/code)
|
||||
id))}
|
||||
(catch Exception e
|
||||
(log/error e)
|
||||
(alog/error ::error :error e)
|
||||
{:status 400
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
@@ -75,7 +77,7 @@
|
||||
(Long/parseLong id)
|
||||
(dissoc data :client-id )))}
|
||||
(catch Exception e
|
||||
(log/error e)
|
||||
(alog/error ::error :error e)
|
||||
{:status 500
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
@@ -93,7 +95,7 @@
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {}) }
|
||||
(catch Exception e
|
||||
(log/error e)
|
||||
(alog/error ::error :error e)
|
||||
{:status 400
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:message (.getMessage e)
|
||||
|
||||
Reference in New Issue
Block a user