Debug output destroys BE HTML
if you use t3lib_div::debug in BE the HTML is corrupted, docheader not clickable etc. It's very weird.
Reason is that t3lib_div::debug use "echo" which doesn't respect any output.
use flash messages. Ensure that the flag "showFlashMessage" is respected, that modern modules with templates render their flashmessage in modulebody, that old modules get the flash messages too, that FE output shows debug too.
It also respect all settings and debug handlers, as t3lib_div::debug is used as "last" output of debug
(issue imported from #M12614)