See https://clojars.org/logbug.
There are two wrapping functionalities:
This functionality logs invocation and result of a function referenced by a var.
Example enable:
(logbug.debug/wrap-with-log-debug #'some-var)
Example log output:
[DEBUG some-ns clojure-agent-send-off-pool-5] [some-var "invoked" {:args ( ...
...
[DEBUG some-ns clojure-agent-send-off-pool-5] [some-var "returns" {:res ...
Example disable again:
(logbug.debug/unwrap-with-log-debug #'some-var)
(logbug.debug/wrap-with-remember-last-argument #'some-var)
(logbug.debug/get-last-argument #'some-var)
(logbug.debug/re-apply-last-argument #'some-var)
Example require the debug namespace:
(require ['logbug.debug :as 'debug])
Example wrap all vars in the current namespace:
(debug/debug-ns *ns*)
Example disable wrappers in the current namespace:
(debug/undebug-ns *ns*)
The use of require
will "remove" existing wrappers. The last arguments are
stored within the debug
ns and thus they survive require
etc.
The dependency on the deprecated clj-logging-config library has been removed. This removes in turn deeper dependencies and makes this library much more flexible to use with any logging framework as long as it works with the de facto standard clojure/tools.logging.
The API has not changed but calls to debug/debug-ns
are affected by this.
debug/debug-ns
did also set the level of the namespace to DEBUG
. Since
version 5.x the level must be changed explicitly if desired. How to do this
depends on the chosen logging framework.
Copyright © 2013 - 2020 Thomas Schank and contributors.
clj-logbug may be used under the terms of either the
or the
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close