140 logging.basicConfig(stream=sys.stdout,
141 format=
'messageCounter %(levelname)-8s %(message)s',
142 level=logging.DEBUG
if args.verbose
else logging.INFO)
144 start = re.compile(args.startPattern)
if args.startPattern
else None
145 end = re.compile(args.endPattern)
if args.endPattern
else None
146 args.ignore.extend(default_ignore_patterns)
147 ignore = [re.compile(p)
for p
in args.ignore]
149 for fname
in args.logfiles:
150 if not os.path.isfile(fname):
151 logging.error(
'Cannot open file %s, skipping', fname)
153 logging.info(
'Analysing file %s', fname)
154 with open(fname, encoding=
'utf-8')
as f:
158 out_file_name =
'MessageCount.{:s}.json'.
format(fname)
161 all_out_file_name =
'Messages.{:s}.json'.
format(fname)