Time for action - adding basic configuration read support
In this example, we'll add some basic configuration file support into our ever-growing log-processing application. There are a few values that we've been passing on the command line that have become somewhat repetitive. Let's fix that.
- First, create
logscan-g.pyas your starting place.
- Update the
importstatements at the top of the file to look like this:
import time import string import sys from optparse import OptionParser from collections import defaultdict from ConfigParser import SafeConfigParser from ConfigParser import ParsingError
- Now, directly below the
MaxSizeHandlerclass, add the following
configuration parserfunction. Note that this is not a part of the ...