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

@@ -2,8 +2,8 @@
#?@
(:clj
[(:require [com.unbounce.dogstatsd.core :as statsd]
[clojure.tools.logging :as log]
[unilog.context :as lc])]))
[com.brunobonacci.mulog :as mu]
[auto-ap.logging :as alog])]))
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn by
@@ -65,16 +65,16 @@
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn heartbeat [f id]
(fn []
#?(:clj (lc/with-context {:source id}
#?(:clj (mu/with-context {:source id}
(try
(log/info "Starting background process " id)
(alog/info ::starting-process :id id)
(f)
(log/info "Completed background process " id)
(alog/info ::ending-process :id id)
(statsd/service-check {:name (str id)
:status :ok}
nil)
(catch Exception e
(log/error e)
(alog/error ::process-failed :error e)
(statsd/service-check {:name (str id)
:status :critical}
nil))))