Indent qdebug output
this is an awkward question: I've got a set of methods that calls each other and I'm using a set of qdebug outputs to follow the method call
qDebug() << "[BEGIN] myMethod";
qDebug() << "[END] myMethod";
This works great, but with a lot of methods on the stack it becomes a trouble to follow the stacktrace. Is there a simple and quick way to implement the method calls and the qdebug output? Otherwise, is there any other class that can help me obtaining such result?
Now my output looks like:
while I'd like something like:
I guess this is not easily possible in C++ or without using AOP, but maybe Qt provides something like this....
The only solution that comes into my mind is to provide a wrapper around the qDebug that will track and increment the indentation each time I enter a method and will decrease every time I exit.
The wrapper solution would have been my suggestion too. It doesn't sound too awkward.