From 627f5c1db5af52cf7a6213dff6828b8a28bb6718 Mon Sep 17 00:00:00 2001 From: Russell Date: Sun, 29 Nov 2015 15:42:16 +0000 Subject: [PATCH] [#137] Add &args support to `swap-config!` (@rsslldnphy) --- src/taoensso/timbre.cljx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/taoensso/timbre.cljx b/src/taoensso/timbre.cljx index bfe9a88e..d3602f28 100644 --- a/src/taoensso/timbre.cljx +++ b/src/taoensso/timbre.cljx @@ -130,9 +130,9 @@ (defmacro with-merged-config [config & body] `(binding [*config* (enc/nested-merge *config* ~config)] ~@body)) -(defn swap-config! [f] - #+cljs (set! *config* (f *config*)) - #+clj (alter-var-root #'*config* f)) +(defn swap-config! [f & args] + #+cljs (set! *config* (apply f *config* args)) + #+clj (apply alter-var-root #'*config* f args)) (defn set-config! [m] (swap-config! (fn [_old] m))) (defn merge-config! [m] (swap-config! (fn [old] (enc/nested-merge old m))))