From c84de61b40933151dec53b199baa7b66648958b4 Mon Sep 17 00:00:00 2001 From: Mikhail Kuzmin Date: Mon, 20 Jan 2025 17:57:24 +0400 Subject: [PATCH] log --- src/darkleaf/di/core.clj | 10 ++++++---- test/darkleaf/di/tutorial/x_inspect_test.clj | 16 +++++++++------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/darkleaf/di/core.clj b/src/darkleaf/di/core.clj index 5fb427a..c591e30 100644 --- a/src/darkleaf/di/core.clj +++ b/src/darkleaf/di/core.clj @@ -889,9 +889,10 @@ Must be the last one in the middleware chain. Both callbacks are expected to accept the following arg `{:keys [key object]}`." - [& {:keys [after-build! after-demolish!] - :or {after-build! (fn no-op [_]) - after-demolish! (fn no-op [_])}}] + [& {:keys [after-build! after-demolish!] + #_#_:as opts + :or {after-build! (fn no-op [_]) + after-demolish! (fn no-op [_])}}] (fn [registry] (fn [key] (let [factory (registry key)] @@ -910,7 +911,8 @@ p/FactoryDescription (description [_] (assoc (p/description factory) - ::will-be-logged true))))))) + ::log {:will-be-logged true + #_#_:opts opts}))))))) (defn- inspect-middleware [] (fn [registry] diff --git a/test/darkleaf/di/tutorial/x_inspect_test.clj b/test/darkleaf/di/tutorial/x_inspect_test.clj index 2acdf74..8f24989 100644 --- a/test/darkleaf/di/tutorial/x_inspect_test.clj +++ b/test/darkleaf/di/tutorial/x_inspect_test.clj @@ -282,14 +282,16 @@ (t/deftest log-test (t/is (= [{:key ::di/implicit-root :dependencies {`foo :required} - :description {::di/kind :ref - :key `foo - :type :required - ::di/will-be-logged true}} + :description {::di/kind :ref + :key `foo + :type :required + ::di/log {:will-be-logged true + #_#_:opts nil}}} {:key `foo - :description {::di/kind :trivial - :object :obj - ::di/will-be-logged true}}] + :description {::di/kind :trivial + :object :obj + ::di/log {:will-be-logged true + #_#_:opts nil}}}] (di/inspect `foo {`foo :obj} (di/log)))))