Troubleshooting guidelines
In this short section, I'd like to give you a few tips that come from my troubleshooting experience.
Using console editors
First, get comfortable using Vim or nano as an editor, and learn the basics of the console. When things break, you don't have the luxury of your editor with all the bells and whistles there. You have to connect to a box and work from there. So it's a very good idea to be comfortable browsing your production environment with console commands, and be able to edit files using console-based editors, such as vi, Vim, or nano. Don't let your usual development environment spoil you.
Where to inspect
My second suggestion concerns where to place your debugging breakpoints. It doesn't matter if you are using print
, a custom function, or pdb
, you still have to choose where to place the calls that provide you with the information, right?
Well, some places are better than others, and there are ways to handle the debugging progression that are better than others...