Summary
In this chapter, we learned how to use logging and debug asynchronous programs.
We started by using logging to spot issues in running software, showing its usefulness in detecting deadlocks by using the spdlog
logging library. Many other libraries were also discussed, describing their relevant features that might be suitable to specific scenarios.
However, not all bugs can be spotted by using logs, and some may only be detected later in the software development life cycle when some issues happen in production, even when dealing with program crashes and incidents. Debuggers are useful tools to inspect running or crashed programs, understand their code path, and find bugs. Several examples and debugger commands were introduced to deal with generic code, but also and especially with multithreaded and asynchronous software, race conditions, and coroutines. Also, the rr
debugger was introduced, showing the potential of including reverse debugging in our developer toolbox.