iwla

iwla Commit Details

Date:2014-12-15 22:30:49 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:e69af5e675d80a76ded9abc6c8413a32a6f288f2
Parents: ba5bd75ac1a4cca6a669ac648c0913a9a097da2d
Message:Start implementing logging

Changes:
MTODO (1 diff)
Miwla.py (4 diffs)

File differences

TODO
66
77
88
9
109
Automatic tests
Add Licence
Free memory as soon as possible
gzip output files
different debug output levels
iwla.py
99
1010
1111
12
1213
1314
1415
......
127128
128129
129130
131
132
133
134
135
136
130137
131138
132139
......
651658
652659
653660
661
662
663
664
654665
655666
656667
......
659670
660671
661672
673
674
675
676
677
678
662679
663680
664681
import gzip
import importlib
import argparse
import logging
from calendar import monthrange
from datetime import date
(conf.POST_HOOK_DIRECTORY , conf.post_analysis_hooks),
(conf.DISPLAY_HOOK_DIRECTORY , conf.display_hooks)]
self.logger = logging.getLogger('iwla')
self.logger.setFormatter(logging.Formatter('%(name)s %(message)s'))
def setLoggerLevel(self, level):
self.logger.setLevel(level)
def getVersion(self):
return IWLA.IWLA_VERSION
parser.add_argument('-f', '--file', dest='file',
help='Analyse this log file')
parser.add_argument('-d', '--log-level', dest='loglevel',
default=logging.INFO,
help='Loglevel')
args = parser.parse_args()
if args.clean_output:
iwla = IWLA()
numeric_level = getattr(logging, args.loglevel.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % (args.loglevel))
iwla.setLoggerLevel(numeric_level)
required_conf = ['analyzed_filename', 'domain_name']
if not validConfRequirements(required_conf, iwla, 'Main Conf'):
sys.exit(0)

Archive Download the corresponding diff file

Branches

Tags