I'm not thrilled about all of this logic happening in order to provide trace output.  I worry this can cause unexpected behavior depending on  whether code is run in trace mode or not, and it is not adding any real value.