I was recently tasked with thinking about returning optional tracing information about the execution of a complex algorithm. It's the kind of data you need to analyse the inner workings - a bit like logging of intermediate results but being programmatically available to the caller and optional.
I only had rather bad ideas that involve too many changes to the core algorithm, like passing additional parameters all the way through. Also Also I couldcouldn't find anything on the web.
thanks fricke