1# 2# SPDX-License-Identifier: GPL-2.0-only 3# 4 5__version__ = "1.0.0" 6 7import os, time 8import sys,logging 9 10def 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 17class NotFoundError(Exception): 18 pass 19