One of the things that’s been slowing me down as I learn JUCE is that I don’t know how to debug properly. If I get runtime errors in my code I usually have to come up with custom ways to test it, which can take me hours, but I’m sure that a more experienced eye could find the problem in minutes. When I was starting out in C++ and writing console applications, it was easy enough to add a single
std::cout line of code to query some variable, but now that I’m working with a JUCE application, I don’t even know how to print simple messages. So,
- What are the easiest ways of printing simple test messages in a JUCE application? Ideally I would like to be able to insert a single line of code and have a message pop up somewhere (in a console, in a new window, or anywhere). I’ve seen people use the
DBG()function before, but I’m not sure how it works, nor if it’s the right tool.
- Does anyone have any general advice for debugging JUCE application code? I’m trying to invest time into learning how to use the CodeBlocks built-in debugger, but I find it confusing in larger applications with multiple dependencies and no console. Is learning how to use the debugger a must, or is it just a matter of style?
Any help would be appreciated. I hope these questions are useful to others also.