Sometimes, application logs are not enough to figure out what is going wrong. Fortunately, we have the Python debugger available to us. This recipe shows how to insert a break point in a method and trace the execution by hand.
Using the Python debugger to trace method execution
Getting ready
We will reuse the export_stock_level() method shown in the two previous recipes. Ensure that you have a copy at hand.
How to do it...
In order to trace the execution of export_stock_level() with pdb, perform the following steps:
- Edit the code of the method, and insert the line highlighted...