fixes sales queries, minor logging tweaks
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
(ns auto-ap.logging
|
||||
(:require [clojure.tools.logging :as log]
|
||||
[unilog.context :as lc]))
|
||||
[unilog.context :as lc]
|
||||
[com.brunobonacci.mulog :as mu]))
|
||||
|
||||
(defn info-event [message context]
|
||||
(lc/with-context context
|
||||
(log/info message)))
|
||||
@@ -13,3 +15,21 @@
|
||||
(defn error-event [message context]
|
||||
(lc/with-context context
|
||||
(log/warn message)))
|
||||
|
||||
(defmacro with-context-as [ctx s & body]
|
||||
`(mu/with-context ~ctx
|
||||
(let [~s (mu/local-context)]
|
||||
~@body)))
|
||||
|
||||
(defmacro capture-context->lc [& body]
|
||||
`(let [~'lc (mu/local-context)]
|
||||
~@body))
|
||||
|
||||
(defmacro info [x & kvs]
|
||||
`(mu/log ~x :status "INFO" ~@kvs ))
|
||||
|
||||
(defmacro warn [x & kvs]
|
||||
`(mu/log ~x :status "WARN" ~@kvs ))
|
||||
|
||||
(defmacro error [x & kvs]
|
||||
`(mu/log ~x :status "ERROR" ~@kvs ))
|
||||
|
||||
Reference in New Issue
Block a user