Summary
In this chapter, we discussed how we can best work to debug our Apex code when we have a bug or issue. We started by noting some of the differences between debugging Apex compared to other languages and platforms due to its cloud-centric execution model.
We then discussed the standard debugging life cycle for most developers, which involves a lot of switching between windows to get static debug logs to inspect. We looked at how we can improve this debug cycle, by first reproducing the bug in a test to (a) reduce our replication time and (b) provide us with a concrete way of ensuring that the bug has been fixed.
Following this, we discussed how we can aid ourselves by improving the way in which we configure the debug log filters within Salesforce to get access to the most relevant information. We then discussed the use of the SFDX CLI to stream these logs to the terminal and then further filter them using the tools provided by the command line. This provided us with a...