Open velle opened 2 months ago
@velle there's already extensive logging code like this, which uses QgsDebugMsgLevel(....). You'll only get the output on debug builds (not release builds, for performance reasons), and you need to set the environment variable QGIS_DEBUG to 2 or greater, where larger numbers result in more verbose logs.
Im asking specifically about adding these debug messages in destructors, and only in a handful of classes. I did not notice any logging in these destructors, when looking in the source code. Is there?
I need something that helps me see what things are destructed and when. That helps me understand what causes segfaults.
There's some in destructors already, more would be welcome if they use QgsDebugMsgLevel appropriately! 👍
Feature description
I have realized that when programming in Python, using the binary C++ back-end of QGIS, I have to care a lot about whether objects are cleaned up before they are supposed to, because of Python garbage collection. Otherwise I run into segfaults.
Because this is new, and honestly quite complex, for me, I have helped myself in debugging such issues by adding some qDebug statements to the C++ code. E.g. in:
I've done this to six classes this far; classes where I either had or suspected such issues.
Would it be welcome if I submitted such debugging code to master? Or will I need to keep this only on my local instance? It takes a long time to recompile the C++ code locally, just to add a couple of debug messages :)
Additional context
No response