- We'll start by implementing basic logging features into the existing functions. This means that we'll need the logging module:
The rest of the application will use a number of other packages:
import argparse import sys from pathlib import Path from collections import Counter import yaml
- We'll create two logger objects as module globals. The creating functions can go anywhere in the script that creates global variables. One location is to put these early, after the import statements. Another common choice is near the end, but outside any __name__ == "__main__" script processing. These variables must always be created, even if the module is imported as a library.
Loggers have hierarchical names. We'll ...