portal

James Pratt 2023-05-08T16:52:15.316949Z

Hi, I think I remember seeing a macro somewhere in one of the clojure libraries in the main distribution or in portal itself that: 1. tap> s a value but then returns the tapped value instead of true, so that I can enclose any form in the macro and not affect code function. 2. also logs the form itself as well as the returned value and/or the line number, file name where the tap> happens and more. In the same library there were macros for tapping threaded expressions as well I think. Am I misremembering or can someone point me to the macro(s). J

James Pratt 2023-05-08T16:54:29.326949Z

Ah, looking at portal.console now.

👍 1
James Pratt 2023-05-08T16:59:57.046279Z

just what I was looking for 🙂

James Pratt 2023-05-08T17:00:23.790689Z

thanks a lot for the great work @djblue

seancorfield 2023-05-08T17:20:48.206429Z

FWIW (doto tap>) in a -> pipeline will do what you want:

(-> expr
    (doto tap>) ; tap expr
    (process) ; process expr
    (doto tap>)) ; tap result

❤️ 1
seancorfield 2023-05-08T17:21:16.151429Z

(although that won't handle exceptions the same way portal.console/log does)

James Pratt 2023-05-08T21:14:13.692769Z

oh, that's handy thanks @seancorfield