We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ring middleware are functions look like:
(defn wrap-me [handler msg] (fn [request] ;; `identity` represent the logic of the middleware: (identity (handler (identity request)))))
They are applied like:
(-> handler (wrap-me "one") (wrap-me "two") (wrap-me "three") ,,,)
Is there a convenient way to apply debux to print in each step the request fed to and the response returned by the handler?
request
handler
I would hope for something like the following to be possible:
(dbgmw (-> handler (wrap-me "one") (wrap-me "two") (wrap-me "three") ,,,))) ; Would print something like: ; dbgmw: (-> handler (wrap-me "one") (wrap-me "two") (wrap-me "three") ,,,) ; | request => {,,,} ; | (wrap-me ,,, "three") => {,,,} ; | (wrap-me ,,, "two") => {,,,} ; | (wrap-me ,,, "one") => {,,,} ; | (handler ,,,) => {,,,}
The text was updated successfully, but these errors were encountered:
Debux doesn't have such a feature you mentioned.
Instead, I recommend the following code snippet to you.
(use 'debux.core) (defn wrap-dbg [handler middleware-name] (fn [req] (dbg req :msg (str "request to " middleware-name)) (let [resp (handler req)] (dbg resp :msg (str "response from " middleware-name)) resp) )) (-> handler (wrap-me "one") (wrap-dbg "wrap-me one") (wrap-me "two") (wrap-dbg "wrap-me two") (wrap-me "three") (wrap-dbg "wrap-me three") ,,,)
Sorry, something went wrong.
No branches or pull requests
Ring middleware are functions look like:
They are applied like:
Is there a convenient way to apply debux to print in each step the
request
fed to and the response returned by thehandler
?I would hope for something like the following to be possible:
The text was updated successfully, but these errors were encountered: