Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | __version__ = "1.0.0" |
2 | |||||
3 | import os, time | ||||
4 | import sys,logging | ||||
5 | |||||
6 | def init_logger(logfile, loglevel): | ||||
7 | numeric_level = getattr(logging, loglevel.upper(), None) | ||||
8 | if not isinstance(numeric_level, int): | ||||
9 | raise ValueError('Invalid log level: %s' % loglevel) | ||||
10 | FORMAT = '%(asctime)-15s %(message)s' | ||||
11 | logging.basicConfig(level=numeric_level, filename=logfile, format=FORMAT) | ||||
12 | |||||
13 | class NotFoundError(Exception): | ||||
14 | pass |