Skip to content

Commit 7b46825

Browse files
committed
fix: comply config path with existing consistency
1 parent 78e9591 commit 7b46825

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/com/moclojer/components/logs.clj

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@
7373
;; If on dev `env`, does basically nothing besides setting the min
7474
;; level. On `prod` env however, an async channel waits for log events,
7575
;; which are then sent to OpenSearch.
76-
(defrecord Logger [config]
76+
(defrecord Logger [cfg]
7777
component/Lifecycle
7878
(start [this]
79-
(let [prod? (= (:env config) :prod)
79+
(let [config (:config cfg)
80+
prod? (= (:env config) :prod)
8081
os-cfg (:opensearch config)
8182
log-ch (async/chan)
8283
os-base-req (build-opensearch-base-req os-cfg)]
@@ -126,18 +127,19 @@
126127
(def logger
127128
(map->Logger
128129
{:config
129-
{:env :prod
130-
:opensearch
131-
{:username "foobar"
132-
:password "foobar"
133-
:host "foobar"
134-
:port 25060
135-
:index "components-test-logs"}}}))
130+
{:config
131+
{:env :prod
132+
:opensearch
133+
{:username "foobar"
134+
:password "foobar"
135+
:host "foobar"
136+
:port 25060
137+
:index "components-test-logs"}}}}))
136138

137139
(component/start logger)
138140
(component/stop logger)
139141

140142
(trace ::testing-stuff {:testing? :definitely}
141-
(log :error "aaaaa aaaa" {:hello true}))
143+
(log :error "aaaaa aaaa" {:hello true}))
142144
;;
143145
)

0 commit comments

Comments
 (0)