Quickly Enable and Disable Debugging by Section using my Debug Library!
For me, debugging often means displaying a whole lot of information (variable values and such) to the screen to make sure everything is working as expect. I think this is the case for most programmers as it's quite effective at giving you a good picture of what the program is doing.
The functions Text Message() and Debug Message() work fine for the most part, but I wanted some more flexibility. Specifically, I wanted to be able enable/disable debugging without having to search and find every call to Debug Message(). In a normal programming language like C, you might see a lot of "#ifdef DEBUG" lines littered throughout the code, but setting up an if statement like this in the GUI can be a burden. I found it easier to just do it all in one function call.
I actually took it a step further, allowing myself to divide my code into sections and enable/disable specific sections for debugging. I find this the most useful because I can enable only the section I am working on, greatly filtering the debug output. I can still quickly enable/disable any other section to fully customize my debugging experience.
Taken even a step further, I found in practice that some debugging message are more detailed than others. It's often useful to be able to debug a section at a high level (low level of debugging detail), while still being able to debug it at a very low level (high level of detail). For example, when you're really digging into code, you may find it useful to print out details from every iteration of a loop. I would consider this too be a high level of detail. Later, when you are debugging the project as a whole, you may still want debug messages from this section, but you won't need to see every iteration of every loop. My library enables you to do this by setting detail levels for your messages.
My library also allows you to set color and screen location for debug messages (by section), as well as output to up to four different files. I've found these tools to be useful when debugging multiple sections at once. There's also a condition that you can use if your debugging doesn't involve writing a message to the screen.
I've covered the "why" here. The "how" is covered in the Usage (README) document included with my library. Please let me know if this is not clear.
If you find this library useful, please let me know. I would be happy to consider any feature requests you may have.
Quickly Enable and Disable Debugging by Section using my Debug Library!
For me, debugging often means displaying a whole lot of information (variable values and such) to the screen to make sure everything is working as expect. I think this is the case for most programmers as it's quite effective at giving you a good picture of what the program is doing.
The functions Text Message() and Debug Message() work fine for the most part, but I wanted some more flexibility. Specifically, I wanted to be able enable/disable debugging without having to search and find every call to Debug Message(). In a normal programming language like C, you might see a lot of "#ifdef DEBUG" lines littered throughout the code, but setting up an if statement like this in the GUI can be a burden. I found it easier to just do it all in one function call.
I actually took it a step further, allowing myself to divide my code into sections and enable/disable specific sections for debugging. I find this the most useful because I can enable only the section I am working on, greatly filtering the debug output. I can still quickly enable/disable any other section to fully customize my debugging experience.
Taken even a step further, I found in practice that some debugging message are more detailed than others. It's often useful to be able to debug a section at a high level (low level of debugging detail), while still being able to debug it at a very low level (high level of detail). For example, when you're really digging into code, you may find it useful to print out details from every iteration of a loop. I would consider this too be a high level of detail. Later, when you are debugging the project as a whole, you may still want debug messages from this section, but you won't need to see every iteration of every loop. My library enables you to do this by setting detail levels for your messages.
My library also allows you to set color and screen location for debug messages (by section), as well as output to up to four different files. I've found these tools to be useful when debugging multiple sections at once. There's also a condition that you can use if your debugging doesn't involve writing a message to the screen.
I've covered the "why" here. The "how" is covered in the Usage (README) document included with my library. Please let me know if this is not clear.
If you find this library useful, please let me know. I would be happy to consider any feature requests you may have.