Documentation and Logging
In this chapter, we will look at two aspects of software development that do not directly influence the operation of the code. The first is documentation, more commonly called comments. The second is logging, a tool used to record events during the run of a program for the purpose of monitoring what the program is doing. We will begin with documenting code inline. You likely noticed that none of the code shown so far in this book has any comments. This has been done on purpose, as each chapter describes what the code is doing. If you look at the book’s code in the GitHub repository, you will find comments in every file.
You have probably seen a message telling you to look at the log file when something goes wrong in a program. Where do these log files come from? We will examine how we can either display messages on the console or write to a file that certain events occurred or exceptions were thrown.
Here is the rundown for this chapter:
-
...