prints don't give you an idea of the global state of an app at a given time, this can be tiresome to solve bugs like that, a debugger is essential. I use the classic stuff: gdb (with python-scripts and gef) for C/C++, ipdb for python, and `debugger` statements for browser and nodejs development.