Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: GPL-2.0-only |
| 3 | # |
| 4 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | __version__ = "1.0.0" |
| 6 | |
| 7 | import os, time |
| 8 | import sys,logging |
| 9 | |
| 10 | def init_logger(logfile, loglevel): |
| 11 | numeric_level = getattr(logging, loglevel.upper(), None) |
| 12 | if not isinstance(numeric_level, int): |
| 13 | raise ValueError('Invalid log level: %s' % loglevel) |
| 14 | FORMAT = '%(asctime)-15s %(message)s' |
| 15 | logging.basicConfig(level=numeric_level, filename=logfile, format=FORMAT) |
| 16 | |
| 17 | class NotFoundError(Exception): |
| 18 | pass |