Using logging for control and audit output
In the Designing scripts for composition recipe earlier in this chapter, we examined three aspects of an application:
- Gathering input
- Producing output
- The essential processing that connects input and output
There are several different kinds of output that applications produce:
- The main output that helps a user make a decision or take action
- Control information that confirms that the program worked completely and correctly
- Audit summaries that are used to track the history of state changes in persistent databases
- Any error messages that indicate why the application didn't work
It's less than optimal to lump all of these various aspects into print()
requests that write to standard output. Indeed, it can lead to confusion because too many different outputs are interleaved in a single stream.
The OS provides each running process with two output files, standard...