Debugging through logging

Debugging is, after all, detecting what's going on inside our program and what unexpected or incorrect effects may be happening. A simple, yet very effective, approach is to output variables and other information at strategic parts of your code to follow the flow of the program.

The simplest form of this approach is called print debugging, or inserting print statements at certain points to print the value of variables or points while debugging.

But taking this technique a little bit further and combining it with the logging techniques presented in Chapter 2Automating Tasks Made Easy allows us to create a semi-permanent trace of the execution of the program, which can be really useful when detecting issues in a running program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.197.167