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