philoskim / debux

A trace-based debugging library for Clojure and ClojureScript.
468 stars 19 forks source link

Feature request: optionally return results instead of printing #21

Open Cyrik opened 2 years ago

Cyrik commented 2 years ago

I've been thinking that it would be great to be able to get the debug results so that it is possible to show them in different UI's, similar to re-frame-debux, but without the re-frame dependency. Other use cases would be logging or piping into REBL, reveal or portal. I've already started a prototype to play around with designs for the interface. If you are interested in the feature I'll fork and push my changes.

philoskim commented 2 years ago

I have been interested in this feature as well. Please send me your pull request for this feature and I will integrate it as much as possible.

Thanks for this feature request and upcoming your pull request!!

Cyrik commented 2 years ago

i've been playing around with a representation of the results that has all the data in a way that can be used to display it. I'm not happy yet, but your input is very welcome

philoskim commented 2 years ago

Your pull request was moved to a new branch 'multiple-outputs'.

Cyrik commented 2 years ago

@philoskim hey, sorry I didn't get back to this for some time. Hoping to continue working on this sometime this week and try to make debux a dependency of my own lib.

meditans commented 2 years ago

I'm also quite interested in this, as I want to display the trace data-structure in portal. I know that some of this has been done, because I see that @Cyrik 's fork of debux can be used as the inner layer of omni-trace. How much of that work is upstreamable? If it's not, was there some agreement of the shape of the datastructure?

Cyrik commented 2 years ago

Sorry it took so long @meditans. My version should be mergable. I think there's a tiny bit of cleanup left to not waste memory if you're only printing.

deejayem commented 1 year ago

Would this also allow the result to be used in a repl?

Cyrik commented 1 year ago

Yes it would, although as @meditans said, my implementation is still a bit messy.