As far as esp8266 debug is concerned, I have spent the last 2 years working on a system trace and performance tool. Unfortunately it is still not finished, and the least finished is the documentation. Since my 30 year career has been in embedded real-time software, I have put all my accumulated knowledge into this new tool, and it's a shame it's not finished yet. I will give some thought over the next week or so, and perhaps if I can package the library up and provide some demos then you could try it out. I will have a think.
In fact a library has functionality to similar to mine which is already available. It's not surprising, since we all want to do similar things. This however, requires use of FreeRTOS, something which the espressif OS-SDK is based upon. By using freeRTOS you can enable trace 'hooks' which can send trace info via serial port to an analysis tool. The tool is called Percepio see https://www.freertos.org/FreeRTOS-Plus/ ... race.shtml
One important thing with this method of system trace (print etc) is that it uses highly compressed info, and so the microprocessor is not held-up in the same way that it is when sending normal text via serial, via printf, println etc. In addition these system trace/print calls are in themselves much faster than printf etc, so all in all the system's operation is mostly unaffected in terms of timing, which of course is essential in real time software. The serial/uart processing normally uses interrupt routines and buffers so that all serial comms is done in the background.
To give you an idea, to print a line of text in esp8266 would take 5ms for 70 chars, whereas the scheme I use (and Percepio probably uses too) only takes 3us, so it is 2000 times more efficient.