If I have a routing setup and I cant figure out why something doesnt match.. what is the easiest way to debug it ?
o
orangy
02/27/2018, 7:08 AM
For now only to debug the routing matching procedure… We need to think how to make it possible without such complexity. Any ideas?
s
spand
02/27/2018, 12:25 PM
Maybe. I think an api could be to put a
var debug: Boolean
on Route. A debugging strategy would then consist of enabling it on the most specific Route handler and gradually expand out manually by edit, compile, retry until the fault is located. Nested Route matchers inherit this debug flag. Debug enabled routes then output why they either match (or maybe be silent in this case) or do not match (maybe something like Hamcrest but could be overkill) to the logger.
o
orangy
02/27/2018, 1:09 PM
That’s a lot of edit/compile/retry… I would may be record a single (complex) object for a routing resolution trace and have a
trace
function on Routing that receives a lambda to do whatever you want with the trace: