blob: 2837e135d7ba27164ed4d6e3bd918673b64e9a58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
__version__ = "1.0.0"
import os, time
import sys,logging
def init_logger(logfile, loglevel):
numeric_level = getattr(logging, loglevel.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % loglevel)
logging.basicConfig(level=numeric_level, filename=logfile)
|